File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ object PostTyper {
17
17
18
18
/** A macro transform that runs immediately after typer and that performs the following functions:
19
19
*
20
- * (1) Add super accessors and protected accessors (@see SuperAccessors)
20
+ * (1) Add super accessors (@see SuperAccessors)
21
21
*
22
22
* (2) Convert parameter fields that have the same name as a corresponding
23
23
* public parameter field in a superclass to a forwarder to the superclass
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ object Inliner {
53
53
*/
54
54
def needsAccessor (sym : Symbol )(implicit ctx : Context ) =
55
55
sym.isTerm &&
56
+ ! sym.info.widenTermRefExpr.isInstanceOf [ConstantType ] &&
56
57
(sym.is(AccessFlags ) || sym.privateWithin.exists) &&
57
58
! sym.isContainedIn(inlineSym)
58
59
Original file line number Diff line number Diff line change
1
+ object Foo {
2
+ private final val C = " Constant"
3
+ }
4
+
5
+ class Foo {
6
+ import Foo ._
7
+ inline def foo (x : Int ): Boolean = x == C .length
8
+ }
9
+
10
+ class Test {
11
+ (new Foo ).foo(1 )
12
+ }
You can’t perform that action at this time.
0 commit comments