File tree 4 files changed +14
-40
lines changed
4 files changed +14
-40
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ object O:
3
3
println(n)
4
4
5
5
class B :
6
- val a = A (this ) // error
6
+ val a = A (this )
7
7
8
8
val b = new B
9
- val n = 10
9
+ val n = 10 // error
10
10
end O
Original file line number Diff line number Diff line change 1
1
-- Error: tests/init/neg/inherit-non-hot.scala:6:32 --------------------------------------------------------------------
2
2
6 | if b == null then b = new B(this) // error
3
3
| ^^^^^^^^^^^^^^^
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
+ | ^^^^^^^^^^^^^^^
13
13
|
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 {
15
15
override def increment (): Unit = {
16
16
def updateA (): Unit = {
17
17
val newA = new A (y)
18
- a = newA // error
18
+ a = newA // ok: newA can be promoted to hot
19
19
}
20
20
y = y + 1
21
21
updateA()
You can’t perform that action at this time.
0 commit comments