Skip to content

Change error message text from "fully-initialized" to "fully initialized" #14400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Errors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ object Errors {

def show(using Context): String = {
var index = 0
"Cannot prove that the value is fully-initialized. " + msg + ".\n" + stacktrace +
"Cannot prove that the value is fully initialized. " + msg + ".\n" + stacktrace +
"\nThe unsafe promotion may cause the following problem:\n" +
errors.head.show + errors.head.stacktrace
}
Expand Down
2 changes: 1 addition & 1 deletion tests/init/neg/closureLeak.check
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/closureLeak.scala:11:14 -----------------------------------------------------------------------
11 | l.foreach(a => a.addX(this)) // error
| ^^^^^^^^^^^^^^^^^
| Cannot prove that the value is fully-initialized. Only initialized values may be used as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
4 changes: 2 additions & 2 deletions tests/init/neg/enum-desugared.check
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/enum-desugared.scala:17:15 --------------------------------------------------------------------
17 | Array(this.LazyErrorId, this.NoExplanationID) // error // error
| ^^^^^^^^^^^^^^^^
| Cannot prove that the value is 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.
|
| The unsafe promotion may cause the following problem:
| Calling the external method method name may cause initialization errors. Calling trace:
Expand All @@ -10,7 +10,7 @@
-- Error: tests/init/neg/enum-desugared.scala:17:33 --------------------------------------------------------------------
17 | Array(this.LazyErrorId, this.NoExplanationID) // error // error
| ^^^^^^^^^^^^^^^^^^^^
| Cannot prove that the value is 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.
|
| The unsafe promotion may cause the following problem:
| Calling the external method method ordinal may cause initialization errors. Calling trace:
Expand Down
2 changes: 1 addition & 1 deletion tests/init/neg/enum.check
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/enum.scala:4:8 --------------------------------------------------------------------------------
4 | NoExplanationID // error
| ^
| Cannot prove that the value is 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.
|
| The unsafe promotion may cause the following problem:
| Calling the external method method name may cause initialization errors. Calling trace:
Expand Down
2 changes: 1 addition & 1 deletion tests/init/neg/inherit-non-hot.check
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/inherit-non-hot.scala:6:34 --------------------------------------------------------------------
6 | if b == null then b = new B(this) // error
| ^^^^^^^^^^^
| Cannot prove that the value is fully-initialized. May only assign fully initialized value.
| Cannot prove that the value is fully initialized. May only assign fully initialized value.
| Calling trace:
| -> val c = new C [ inherit-non-hot.scala:19 ]
| -> class C extends A { [ inherit-non-hot.scala:15 ]
Expand Down
2 changes: 1 addition & 1 deletion tests/init/neg/promotion-loop.check
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Error: tests/init/neg/promotion-loop.scala:16:10 --------------------------------------------------------------------
16 | println(b) // error
| ^
| Cannot prove that the value is fully-initialized. Only initialized values may be used as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
4 changes: 2 additions & 2 deletions tests/init/neg/t3273.check
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- Error: tests/init/neg/t3273.scala:4:42 ------------------------------------------------------------------------------
4 | val num1: LazyList[Int] = 1 #:: num1.map(_ + 1) // error
| ^^^^^^^^^^^^^^^
| Cannot prove that the value is fully-initialized. Only initialized values may be used as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Access non-initialized value num1. Calling trace:
| -> val num1: LazyList[Int] = 1 #:: num1.map(_ + 1) // error [ t3273.scala:4 ]
-- Error: tests/init/neg/t3273.scala:5:61 ------------------------------------------------------------------------------
5 | val num2: LazyList[Int] = 1 #:: num2.iterator.map(_ + 1).to(LazyList) // error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Cannot prove that the value is fully-initialized. Only initialized values may be used as arguments.
| Cannot prove that the value is fully initialized. Only initialized values may be used as arguments.
|
| The unsafe promotion may cause the following problem:
| Access non-initialized value num2. Calling trace:
Expand Down