-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating error message
- Loading branch information
Showing
13 changed files
with
41 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
-- Error: tests/init/neg/closureLeak.scala:11:14 ----------------------------------------------------------------------- | ||
11 | l.foreach(a => a.addX(this)) // error | ||
| ^^^^^^^^^^^^^^^^^ | ||
| Promoting the value to fully-initialized is unsafe. May only use initialized value as arguments | ||
| Promoting the value to fully-initialized is unsafe. May only use initialized value as arguments | ||
| | ||
| The unsafe promotion may cause the following problem(s): | ||
| The unsafe promotion may cause the following problem(s): | ||
| | ||
| 1. Promote the value under initialization to fully-initialized. May only use initialized value as arguments. | ||
| 1. Cannot prove that the value is fully initialized. May only use initialized value as arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
-- Error: tests/init/neg/cycle-structure.scala:3:14 -------------------------------------------------------------------- | ||
3 | val x = B(this) // error | ||
| ^^^^ | ||
| Promote the value under initialization to fully-initialized. May only use initialized value as arguments. | ||
| Cannot prove that the value is fully initialized. May only use initialized value as arguments. | ||
-- Error: tests/init/neg/cycle-structure.scala:9:14 -------------------------------------------------------------------- | ||
9 | val x = A(this) // error | ||
| ^^^^ | ||
| Promote the value under initialization to fully-initialized. May only use initialized value as arguments. | ||
| Cannot prove that the value is fully initialized. May only use initialized value as arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
-- Error: tests/init/neg/default-this.scala:9:8 ------------------------------------------------------------------------ | ||
9 | compare() // error | ||
| ^^^^^^^ | ||
|Promote the value under initialization to fully-initialized. May only use initialized value as arguments. Calling trace: | ||
| -> val result = updateThenCompare(5) [ default-this.scala:11 ] | ||
| Cannot prove that the value is fully initialized. May only use initialized value as arguments. Calling trace: | ||
| -> val result = updateThenCompare(5) [ default-this.scala:11 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// This is a minimized test for the warning in Names.scala:174 | ||
object Foo { | ||
abstract class A { | ||
var b: B = null | ||
def toB: B = | ||
if b == null then b = new B(this) // error | ||
b | ||
} | ||
|
||
class B(a: A) { | ||
var aCopy: A = a | ||
def getBAgain: B = aCopy.toB | ||
} | ||
|
||
class C extends A { | ||
val bAgain = toB.getBAgain | ||
} | ||
|
||
val c = new C | ||
assert(c.b == c.bAgain) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
-- Error: tests/init/neg/leak-warm.scala:18:26 ------------------------------------------------------------------------- | ||
18 | val l: List[A] = List(c, d) // error // error | ||
| ^ | ||
|Promote the value under initialization to fully-initialized. May only use initialized value as method arguments. | ||
| Cannot prove that the value is fully initialized. May only use initialized value as method arguments. | ||
-- Error: tests/init/neg/leak-warm.scala:18:29 ------------------------------------------------------------------------- | ||
18 | val l: List[A] = List(c, d) // error // error | ||
| ^ | ||
|Promote the value under initialization to fully-initialized. May only use initialized value as method arguments. | ||
| Cannot prove that the value is fully initialized. May only use initialized value as method arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
-- Error: tests/init/neg/local-warm4.scala:18:20 ----------------------------------------------------------------------- | ||
18 | a = newA // error | ||
| ^^^^ | ||
|Promote the value under initialization to fully-initialized. May only assign fully initialized value. Calling trace: | ||
| -> val a = new A(5) [ local-warm4.scala:26 ] | ||
| -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ] | ||
| -> val b = new B(y) [ local-warm4.scala:10 ] | ||
| -> class B(x: Int) extends A(x) { [ local-warm4.scala:13 ] | ||
| -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ] | ||
| -> increment() [ local-warm4.scala:9 ] | ||
| -> updateA() [ local-warm4.scala:21 ] | ||
| Cannot prove that the value is fully initialized. May only assign fully initialized value. Calling trace: | ||
| -> val a = new A(5) [ local-warm4.scala:26 ] | ||
| -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ] | ||
| -> val b = new B(y) [ local-warm4.scala:10 ] | ||
| -> class B(x: Int) extends A(x) { [ local-warm4.scala:13 ] | ||
| -> class A(x: Int) extends Foo(x) { [ local-warm4.scala:6 ] | ||
| -> increment() [ local-warm4.scala:9 ] | ||
| -> updateA() [ local-warm4.scala:21 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,3 @@ object localWarm { | |
} | ||
val a = new A(5) | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.