Skip to content

Commit db6f72f

Browse files
committed
Add more tests
1 parent 9620f9d commit db6f72f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/init/pos/early-promote.scala

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class Y {
2+
class X {
3+
class B {
4+
def g = f
5+
def g2 = n
6+
}
7+
val f = 42
8+
val b = new B // warm(B, X.this)
9+
}
10+
11+
val n = 10
12+
val x = new X
13+
List(x.b) // unsafe promotion
14+
15+
}
16+
17+
class A { // checking A
18+
class B {
19+
def bf = 42
20+
class C {
21+
def x = bf // uses outer[C], but never outer[B]
22+
}
23+
List((new C).x)
24+
def c = new C
25+
}
26+
val b = new B()
27+
List(b) // Direct promotion works here
28+
val af = 42
29+
}

0 commit comments

Comments
 (0)