File tree Expand file tree Collapse file tree 14 files changed +61
-38
lines changed
Expand file tree Collapse file tree 14 files changed +61
-38
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11-- Error: tests/init/neg/closureLeak.scala:11:14 -----------------------------------------------------------------------
2211 | l.foreach(a => a.addX(this)) // error
33 | ^^^^^^^^^^^^^^^^^
4- | Cannot prove that the value is fully-initialized. May only use initialized value as arguments.
4+ | Cannot prove that the value is fully-initialized. May only use initialized value as arguments.
55 |
6- | The unsafe promotion may cause the following problem:
7- | Promote the value under initialization to fully- initialized. May only use initialized value as arguments.
6+ | The unsafe promotion may cause the following problem:
7+ | Cannot prove that the value is fully initialized. May only use initialized value as arguments.
Original file line number Diff line number Diff line change 11-- Error: tests/init/neg/cycle-structure.scala:3:14 --------------------------------------------------------------------
223 | val x = B(this) // error
33 | ^^^^
4- | Promote the value under initialization to fully- initialized. May only use initialized value as arguments.
4+ | Cannot prove that the value is fully initialized. May only use initialized value as arguments.
55-- Error: tests/init/neg/cycle-structure.scala:9:14 --------------------------------------------------------------------
669 | val x = A(this) // error
77 | ^^^^
8- | Promote the value under initialization to fully- initialized. May only use initialized value as arguments.
8+ | Cannot prove that the value is fully initialized. May only use initialized value as arguments.
Original file line number Diff line number Diff line change 11-- Error: tests/init/neg/default-this.scala:9:8 ------------------------------------------------------------------------
229 | compare() // error
33 | ^^^^^^^
4- |Promote the value under initialization to fully- initialized. May only use initialized value as arguments. Calling trace:
5- | -> val result = updateThenCompare(5) [ default-this.scala:11 ]
4+ | Cannot prove that the value is fully initialized. May only use initialized value as arguments. Calling trace:
5+ | -> val result = updateThenCompare(5) [ default-this.scala:11 ]
Original file line number Diff line number Diff line change 1+ -- Error: tests/init/neg/inherit-non-hot.scala:6:34 --------------------------------------------------------------------
2+ 6 | if b == null then b = new B(this) // error
3+ | ^^^^^^^^^^^
4+ | Cannot prove that the value is fully-initialized. May only assign fully initialized value.
5+ | Calling trace:
6+ | -> val c = new C [ inherit-non-hot.scala:19 ]
7+ | -> class C extends A { [ inherit-non-hot.scala:15 ]
8+ | -> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
9+ |
10+ | The unsafe promotion may cause the following problem:
11+ | Call method Foo.B.this.aCopy.toB on a value with an unknown initialization. Calling trace:
12+ | -> val c = new C [ inherit-non-hot.scala:19 ]
13+ | -> class C extends A { [ inherit-non-hot.scala:15 ]
14+ | -> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]
15+ | -> if b == null then b = new B(this) // error [ inherit-non-hot.scala:6 ]
16+ | -> def getBAgain: B = aCopy.toB [ inherit-non-hot.scala:12 ]
Original file line number Diff line number Diff line change 1+ // This is a minimized test for the warning in Names.scala:174
2+ object Foo {
3+ abstract class A {
4+ var b : B = null
5+ def toB : B =
6+ if b == null then b = new B (this ) // error
7+ b
8+ }
9+
10+ class B (a : A ) {
11+ var aCopy : A = a
12+ def getBAgain : B = aCopy.toB
13+ }
14+
15+ class C extends A {
16+ val bAgain = toB.getBAgain
17+ }
18+
19+ val c = new C
20+ assert(c.b == c.bAgain)
21+ }
Original file line number Diff line number Diff line change 11-- Error: tests/init/neg/leak-warm.scala:18:26 -------------------------------------------------------------------------
2218 | val l: List[A] = List(c, d) // error // error
33 | ^
4- |Promote the value under initialization to fully- initialized. May only use initialized value as method arguments.
4+ | Cannot prove that the value is fully initialized. May only use initialized value as method arguments.
55-- Error: tests/init/neg/leak-warm.scala:18:29 -------------------------------------------------------------------------
6618 | val l: List[A] = List(c, d) // error // error
77 | ^
8- |Promote the value under initialization to fully- initialized. May only use initialized value as method arguments.
8+ | Cannot prove that the value is fully initialized. May only use initialized value as method arguments.
Original file line number Diff line number Diff line change 11-- Error: tests/init/neg/local-warm4.scala:18:20 -----------------------------------------------------------------------
2218 | a = newA // error
33 | ^^^^
4- |Promote the value under initialization to fully- initialized. May only assign fully initialized value. Calling trace:
5- | -> val a = new A(5) [ local-warm4.scala:26 ]
6- | -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ]
7- | -> val b = new B(y) [ local-warm4.scala:10 ]
8- | -> class B(x: Int) extends A(x) { [ local-warm4.scala:13 ]
9- | -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ]
10- | -> increment() [ local-warm4.scala:9 ]
11- | -> updateA() [ local-warm4.scala:21 ]
4+ | Cannot prove that the value is fully initialized. May only assign fully initialized value. Calling trace:
5+ | -> val a = new A(5) [ local-warm4.scala:26 ]
6+ | -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ]
7+ | -> val b = new B(y) [ local-warm4.scala:10 ]
8+ | -> class B(x: Int) extends A(x) { [ local-warm4.scala:13 ]
9+ | -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ]
10+ | -> increment() [ local-warm4.scala:9 ]
11+ | -> updateA() [ local-warm4.scala:21 ]
Original file line number Diff line number Diff line change @@ -25,7 +25,3 @@ object localWarm {
2525 }
2626 val a = new A (5 )
2727}
28-
29-
30-
31-
You can’t perform that action at this time.
0 commit comments