Skip to content

Commit 7c12df0

Browse files
committed
Tweak message: make clear it is reassignment
1 parent 73e64a7 commit 7c12df0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,12 +1221,12 @@ object Semantic {
12211221
eval(qual, thisV, klass)
12221222
val res = eval(rhs, thisV, klass)
12231223
extendTrace(rhs) {
1224-
res.ensureHot("The RHS of an assignment to a field must be fully initialized.")
1224+
res.ensureHot("The RHS of reassignment must be fully initialized.")
12251225
}
12261226
case id: Ident =>
12271227
val res = eval(rhs, thisV, klass)
12281228
extendTrace(rhs) {
1229-
res.ensureHot("The RHS of an assignment to a field must be fully initialized.")
1229+
res.ensureHot("The RHS of reassignment must be fully initialized.")
12301230
}
12311231

12321232
case closureDef(ddef) =>

tests/init/neg/inherit-non-hot.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Error: tests/init/neg/inherit-non-hot.scala:6:34 --------------------------------------------------------------------
22
6 | if b == null then b = new B(this) // error
33
| ^^^^^^^^^^^
4-
| The RHS of an assignment to a field must be fully initialized. Calling trace:
4+
| The RHS of reassignment must be fully initialized. Calling trace:
55
| -> object Foo { [ inherit-non-hot.scala:2 ]
66
| ^
77
| -> val c = new C [ inherit-non-hot.scala:19 ]

tests/init/neg/local-warm4.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Error: tests/init/neg/local-warm4.scala:18:20 -----------------------------------------------------------------------
22
18 | a = newA // error
33
| ^^^^
4-
| The RHS of an assignment to a field must be fully initialized. Calling trace:
4+
| The RHS of reassignment must be fully initialized. Calling trace:
55
| -> object localWarm { [ local-warm4.scala:1 ]
66
| ^
77
| -> val a = new A(5) [ local-warm4.scala:26 ]

0 commit comments

Comments
 (0)