File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,9 @@ class Compiler {
54
54
new ElimRepeated ,
55
55
new ElimLocals ),
56
56
List (new ExtensionMethods ),
57
- List (new TailRec , new ExplicitOuter ),
57
+ List (new TailRec ),
58
58
List (new PatternMatcher ,
59
+ new ExplicitOuter ,
59
60
// new LazyValTranformContext().transformer, // disabled, awaiting fixes
60
61
new Splitter ),
61
62
List (new ElimByName ,
Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
69
69
private def newOuterAccessors (cls : ClassSymbol )(implicit ctx : Context ) =
70
70
newOuterAccessor(cls, cls) :: (if (cls is Trait ) Nil else newOuterParamAccessor(cls) :: Nil )
71
71
72
+ /** Ensure that class `cls` has outer accessors */
73
+ def ensureOuterAccessors (cls : ClassSymbol )(implicit ctx : Context ): Unit = {
74
+ if (! hasOuter(cls)) newOuterAccessors(cls).foreach(_.enteredAfter(thisTransformer))
75
+ }
76
+
72
77
/** First, add outer accessors if a class does not have them yet and it references an outer this.
73
78
* If the class has outer accessors, implement them.
74
79
* Furthermore, if a parent trait might have an outer accessor,
@@ -86,7 +91,7 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
86
91
if (needsOuterIfReferenced(cls) &&
87
92
! needsOuterAlways(cls) &&
88
93
impl.existsSubTree(referencesOuter(cls, _)))
89
- newOuterAccessors (cls).foreach(_.enteredAfter(thisTransformer) )
94
+ ensureOuterAccessors (cls)
90
95
if (hasOuter(cls)) {
91
96
val newDefs = new mutable.ListBuffer [Tree ]
92
97
if (isTrait)
You can’t perform that action at this time.
0 commit comments