@@ -96,6 +96,7 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>
96
96
val parentTp = cls.denot.thisType.baseType(parentTrait)
97
97
val outerAccImpl = newOuterAccessor(cls, parentTrait).enteredAfter(thisPhase)
98
98
newDefs += DefDef (outerAccImpl, singleton(fixThis(outerPrefix(parentTp))))
99
+ .showing(i " outAcc $result, ${outerPrefix(parentTp)}" )
99
100
}
100
101
101
102
val parents1 =
@@ -171,14 +172,12 @@ object ExplicitOuter {
171
172
val outerCls = outerClass(cls)
172
173
val prefix = owner.thisType.baseType(cls).normalizedPrefix
173
174
val target =
174
- if owner == cls then outerCls.appliedRef
175
- else outerThis.baseType(outerCls).orElse(prefix.widen)
176
- /* println(i"""new outer $name in $owner, $cls,
177
- |prefix = $prefix,
178
- |outerThis = $outerThis,
179
- |outCls = $outerCls,
180
- |baseType = ${outerThis.baseType(outerCls)}
181
- |target = $target""")*/
175
+ if (owner == cls)
176
+ outerCls.appliedRef
177
+ else
178
+ outerThis.baseType(outerCls).orElse(
179
+ if prefix == NoPrefix then outerCls.typeRef.appliedTo(outerCls.typeParams.map(_ => TypeBounds .empty))
180
+ else prefix.widen)
182
181
val info = if (flags.is(Method )) ExprType (target) else target
183
182
atPhaseNoEarlier(explicitOuterPhase.next) { // outer accessors are entered at explicitOuter + 1, should not be defined before.
184
183
newSymbol(owner, name, Synthetic | flags, info, coord = cls.coord)
0 commit comments