File tree 2 files changed +26
-1
lines changed
compiler/src/dotty/tools/dotc/transform 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,8 @@ object ExplicitOuter {
276
276
if (tpe.prefix eq NoPrefix ) cls.owner.enclosingClass.thisType
277
277
else tpe.prefix
278
278
case _ =>
279
- outerPrefix(tpe.underlying)
279
+ // Need to be careful to dealias before erasure, otherwise we lose prefixes.
280
+ outerPrefix(tpe.underlying(ctx.withPhaseNoLater(ctx.erasurePhase)))
280
281
}
281
282
case tpe : TypeProxy =>
282
283
outerPrefix(tpe.underlying)
Original file line number Diff line number Diff line change
1
+ class AbsCell {
2
+ type T = Node
3
+ class Node
4
+ }
5
+
6
+ object Test {
7
+ def test : Unit = {
8
+ val cell = new AbsCell
9
+ new cell.T
10
+ }
11
+ }
12
+
13
+ class AbsCell2 {
14
+ type T = Node
15
+ val value : T = value
16
+ def set (x : T ): Unit = {}
17
+ class Node
18
+ }
19
+ object init {
20
+ def main = {
21
+ val cell = new AbsCell2 { val init = new Node }
22
+ cell set (new cell.T )
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments