File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,16 @@ object Inliner {
48
48
def accessorNameKind = InlineAccessorName
49
49
50
50
/** A definition needs an accessor if it is private, protected, or qualified private
51
- * and it is not part of the tree that gets inlined. The latter test is implemented
52
- * by excluding all symbols properly contained in the inlined method.
53
- */
51
+ * and it is not part of the tree that gets inlined. The latter test is implemented
52
+ * by excluding all symbols properly contained in the inlined method.
53
+ *
54
+ * Constants don't need accessors since they are inlined in FirstTransform.
55
+ */
54
56
def needsAccessor (sym : Symbol )(implicit ctx : Context ) =
55
57
sym.isTerm &&
56
- ! sym.info.widenTermRefExpr.isInstanceOf [ConstantType ] &&
57
58
(sym.is(AccessFlags ) || sym.privateWithin.exists) &&
58
- ! sym.isContainedIn(inlineSym)
59
+ ! sym.isContainedIn(inlineSym) &&
60
+ ! sym.info.widenTermRefExpr.isInstanceOf [ConstantType ]
59
61
60
62
def preTransform (tree : Tree )(implicit ctx : Context ): Tree
61
63
You can’t perform that action at this time.
0 commit comments