Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jul 4, 2022
1 parent f51e1fc commit 97e7fcc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 40 deletions.
4 changes: 2 additions & 2 deletions tests/init/neg/apply2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ object O:
println(n)

class B:
val a = A(this) // error
val a = A(this)

val b = new B
val n = 10
val n = 10 // error
end O
22 changes: 11 additions & 11 deletions tests/init/neg/inherit-non-hot.check
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- Error: tests/init/neg/inherit-non-hot.scala:6:32 --------------------------------------------------------------------
6 | if b == null then b = new B(this) // error
| ^^^^^^^^^^^^^^^
| The RHS of reassignment must be fully initialized. Calling trace:
| -> class C extends A { [ inherit-non-hot.scala:15 ]
| ^
| -> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
| ^^^
| -> def toB: B = [ inherit-non-hot.scala:5 ]
| ^
| -> if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
| ^^^^^^^^^^^^^^^
|The RHS of reassignment must be fully initialized. Found = Warm[class B] { outer = Hot, args = (Cold) }. Calling trace:
|-> class C extends A { [ inherit-non-hot.scala:15 ]
| ^
|-> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
| ^^^
|-> def toB: B = [ inherit-non-hot.scala:5 ]
| ^
|-> if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
| ^^^^^^^^^^^^^^^
|
| Promoting the value to fully initialized failed due to the following problem:
| Cannot prove that the field val a is fully initialized.
|Promoting the value to fully initialized failed due to the following problem:
|Cannot prove that the field val a is fully initialized.
26 changes: 0 additions & 26 deletions tests/init/neg/local-warm4.check

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object localWarm {
override def increment(): Unit = {
def updateA(): Unit = {
val newA = new A(y)
a = newA // error
a = newA // ok: newA can be promoted to hot
}
y = y + 1
updateA()
Expand Down

0 comments on commit 97e7fcc

Please sign in to comment.