diff --git a/compiler/src/dotty/tools/dotc/transform/init/Errors.scala b/compiler/src/dotty/tools/dotc/transform/init/Errors.scala index 0aebf5b1afa0..9f3e0d1fcc47 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Errors.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Errors.scala @@ -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 } diff --git a/tests/init/neg/closureLeak.check b/tests/init/neg/closureLeak.check index cd75987b8f76..3bd3cdd09b9b 100644 --- a/tests/init/neg/closureLeak.check +++ b/tests/init/neg/closureLeak.check @@ -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. diff --git a/tests/init/neg/enum-desugared.check b/tests/init/neg/enum-desugared.check index 567b8104c154..6417b8c5cea7 100644 --- a/tests/init/neg/enum-desugared.check +++ b/tests/init/neg/enum-desugared.check @@ -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: @@ -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: diff --git a/tests/init/neg/enum.check b/tests/init/neg/enum.check index 06e797624646..eb48920b47ea 100644 --- a/tests/init/neg/enum.check +++ b/tests/init/neg/enum.check @@ -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: diff --git a/tests/init/neg/inherit-non-hot.check b/tests/init/neg/inherit-non-hot.check index f6f45edfc9a6..af95b2a7284b 100644 --- a/tests/init/neg/inherit-non-hot.check +++ b/tests/init/neg/inherit-non-hot.check @@ -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 ] diff --git a/tests/init/neg/promotion-loop.check b/tests/init/neg/promotion-loop.check index 4ed16ee3ea37..b53dd676081f 100644 --- a/tests/init/neg/promotion-loop.check +++ b/tests/init/neg/promotion-loop.check @@ -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. diff --git a/tests/init/neg/t3273.check b/tests/init/neg/t3273.check index ca8b7f4dc9ad..531e8f6f5ad3 100644 --- a/tests/init/neg/t3273.check +++ b/tests/init/neg/t3273.check @@ -1,7 +1,7 @@ -- 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: @@ -9,7 +9,7 @@ -- 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: