-
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.
Merge pull request #15584 from dotty-staging/fix-init-error
Underline assignment correctly in error message
- Loading branch information
Showing
6 changed files
with
49 additions
and
53 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
-- Error: tests/init/neg/inherit-non-hot.scala:6:34 -------------------------------------------------------------------- | ||
-- 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. |
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
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,8 @@ | ||
import scala.collection.mutable | ||
|
||
class Translater: | ||
val count = new mutable.HashMap[Int, Int] { | ||
override def default(key: Int) = 0 | ||
} | ||
count.get(10) | ||
val n = 10 |