File tree Expand file tree Collapse file tree 4 files changed +14
-40
lines changed
Expand file tree Collapse file tree 4 files changed +14
-40
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ object O:
33 println(n)
44
55 class B :
6- val a = A (this ) // error
6+ val a = A (this )
77
88 val b = new B
9- val n = 10
9+ val n = 10 // error
1010end O
Original file line number Diff line number Diff line change 11-- Error: tests/init/neg/inherit-non-hot.scala:6:32 --------------------------------------------------------------------
226 | if b == null then b = new B(this) // error
33 | ^^^^^^^^^^^^^^^
4- | The RHS of reassignment must be fully initialized. Calling trace:
5- | -> class C extends A { [ inherit-non-hot.scala:15 ]
6- | ^
7- | -> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
8- | ^^^
9- | -> def toB: B = [ inherit-non-hot.scala:5 ]
10- | ^
11- | -> if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
12- | ^^^^^^^^^^^^^^^
4+ |The RHS of reassignment must be fully initialized. Found = Warm[class B] { outer = Hot, args = (Cold) }. Calling trace:
5+ |-> class C extends A { [ inherit-non-hot.scala:15 ]
6+ | ^
7+ |-> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
8+ | ^^^
9+ |-> def toB: B = [ inherit-non-hot.scala:5 ]
10+ | ^
11+ |-> if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
12+ | ^^^^^^^^^^^^^^^
1313 |
14- | Promoting the value to fully initialized failed due to the following problem:
15- | Cannot prove that the field val a is fully initialized.
14+ |Promoting the value to fully initialized failed due to the following problem:
15+ |Cannot prove that the field val a is fully initialized.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ object localWarm {
1515 override def increment (): Unit = {
1616 def updateA (): Unit = {
1717 val newA = new A (y)
18- a = newA // error
18+ a = newA // ok: newA can be promoted to hot
1919 }
2020 y = y + 1
2121 updateA()
You can’t perform that action at this time.
0 commit comments