Skip to content

Commit 222c6be

Browse files
committed
Attempting another fix
I am not sure about what I am doing here since I can't reproduce the CI build problem locally.
1 parent 912850b commit 222c6be

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>
9696
val parentTp = cls.denot.thisType.baseType(parentTrait)
9797
val outerAccImpl = newOuterAccessor(cls, parentTrait).enteredAfter(thisPhase)
9898
newDefs += DefDef(outerAccImpl, singleton(fixThis(outerPrefix(parentTp))))
99+
.showing(i"outAcc $result, ${outerPrefix(parentTp)}")
99100
}
100101

101102
val parents1 =
@@ -171,14 +172,12 @@ object ExplicitOuter {
171172
val outerCls = outerClass(cls)
172173
val prefix = owner.thisType.baseType(cls).normalizedPrefix
173174
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)
182181
val info = if (flags.is(Method)) ExprType(target) else target
183182
atPhaseNoEarlier(explicitOuterPhase.next) { // outer accessors are entered at explicitOuter + 1, should not be defined before.
184183
newSymbol(owner, name, Synthetic | flags, info, coord = cls.coord)

0 commit comments

Comments
 (0)