File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -84,14 +84,19 @@ class ExplicitOuter extends MiniPhaseTransform with InfoTransformer { thisTransf
84
84
newDefs += ValDef (outerParamAcc, EmptyTree )
85
85
newDefs += DefDef (outerAccessor(cls).asTerm, ref(outerParamAcc))
86
86
}
87
+
88
+ for (parentTrait <- cls.mixins) {
89
+ if (needsOuterIfReferenced(parentTrait)) {
90
+ val parentTp = cls.denot.thisType.baseTypeRef(parentTrait)
91
+ val outerAccImpl = newOuterAccessor(cls, parentTrait).enteredAfter(thisTransformer)
92
+ newDefs += DefDef (outerAccImpl, singleton(outerPrefix(parentTp)))
93
+ }
94
+ }
95
+
87
96
val parents1 =
88
97
for (parent <- impl.parents) yield {
89
98
val parentCls = parent.tpe.classSymbol.asClass
90
99
if (parentCls.is(Trait )) {
91
- if (needsOuterIfReferenced(parentCls)) {
92
- val outerAccImpl = newOuterAccessor(cls, parentCls).enteredAfter(thisTransformer)
93
- newDefs += DefDef (outerAccImpl, singleton(outerPrefix(parent.tpe)))
94
- }
95
100
parent
96
101
}
97
102
else parent match { // ensure class parent is a constructor
You can’t perform that action at this time.
0 commit comments