Skip to content

Commit 36298a2

Browse files
committed
Address feedback.
1 parent 6f22980 commit 36298a2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object Semantic:
6767
"the original object of type (" + klass.show + ") where initialization checking started"
6868
case Warm(klass, outer, ctor, args) =>
6969
val argsText = if args.nonEmpty then ", args = " + args.map(_.show).mkString("(", ", ", ")") else ""
70-
"an initialized (Warm) object of type (" + klass.show + ") { outer = " + outer.show + argsText + " }"
70+
"a non-transitively initialized (Warm) object of type (" + klass.show + ") { outer = " + outer.show + argsText + " }"
7171
case Fun(expr, thisV, klass) =>
7272
"a function where \"this\" is (" + thisV.show + ") and the function owner is an object of type (" + klass.show + ")"
7373
case RefSet(values) =>
@@ -472,7 +472,7 @@ object Semantic:
472472
def widenArg: Contextual[Value] =
473473
a match
474474
case _: Ref | _: Fun =>
475-
val hasError = Reporter.hasErrors { a.promote("Argument cannot be proven to be transitively initialized (Hot)") }
475+
val hasError = Reporter.hasErrors { a.promote("Argument is not provably transitively initialized (Hot)") }
476476
if hasError then Cold else Hot
477477

478478
case RefSet(refs) =>
@@ -710,7 +710,7 @@ object Semantic:
710710
promoteArgs()
711711
// try promoting the receiver as last resort
712712
val hasErrors = Reporter.hasErrors {
713-
ref.promote(ref.show + " has no source code and could not be proven to be transitively initialized (Hot).")
713+
ref.promote(ref.show + " has no source code and is not provably transitively initialized (Hot).")
714714
}
715715
if hasErrors then
716716
val error = CallUnknown(target)(trace)

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:32 --------------------------------------------------------------------
22
6 | if b == null then b = new B(this) // error
33
| ^^^^^^^^^^^^^^^
4-
|The RHS of reassignment must be transitively initialized (Hot). It was found to be an initialized (Warm) object of type (class B) { outer = a transitively initialized (Hot) object, args = (an uninitialized (Cold) object) }. Calling trace:
4+
|The RHS of reassignment must be transitively initialized (Hot). It was found to be a non-transitively initialized (Warm) object of type (class B) { outer = a transitively initialized (Hot) object, args = (an uninitialized (Cold) object) }. Calling trace:
55
|-> class C extends A { [ inherit-non-hot.scala:15 ]
66
| ^
77
|-> val bAgain = toB.getBAgain [ inherit-non-hot.scala:16 ]

tests/init/neg/promotion-loop.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Error: tests/init/neg/promotion-loop.scala:16:10 --------------------------------------------------------------------
22
16 | println(b) // error
33
| ^
4-
|Could not verify that the method argument is transitively initialized (Hot). It was found to be an initialized (Warm) object of type (class B) { outer = the original object of type (class Test) where initialization checking started }. Only transitively initialized arguments may be passed to methods outside the analyzed initialization region. Calling trace:
4+
|Could not verify that the method argument is transitively initialized (Hot). It was found to be a non-transitively initialized (Warm) object of type (class B) { outer = the original object of type (class Test) where initialization checking started }. Only transitively initialized arguments may be passed to methods outside the analyzed initialization region. Calling trace:
55
|-> class Test { test => [ promotion-loop.scala:1 ]
66
| ^
77
|-> println(b) // error [ promotion-loop.scala:16 ]

tests/init/neg/promotion-segment3.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Error: tests/init/neg/promotion-segment3.scala:9:6 ------------------------------------------------------------------
22
9 | bar(new B) // error
33
| ^^^^^
4-
|Could not verify that the method argument is transitively initialized (Hot). It was found to be an initialized (Warm) object of type (class B) { outer = the original object of type (class A) where initialization checking started }. Only transitively initialized arguments may be passed to methods outside the analyzed initialization region. Calling trace:
4+
|Could not verify that the method argument is transitively initialized (Hot). It was found to be a non-transitively initialized (Warm) object of type (class B) { outer = the original object of type (class A) where initialization checking started }. Only transitively initialized arguments may be passed to methods outside the analyzed initialization region. Calling trace:
55
|-> class A: [ promotion-segment3.scala:2 ]
66
| ^
77
|-> bar(new B) // error [ promotion-segment3.scala:9 ]

0 commit comments

Comments
 (0)