We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9620f9d commit db6f72fCopy full SHA for db6f72f
tests/init/pos/early-promote.scala
@@ -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
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