Skip to content

Commit d7754d9

Browse files
committed
Refine error message
1 parent c427046 commit d7754d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ object Semantic:
673673
if obj.hasField(target) then
674674
obj.field(target)
675675
else if ref.isInstanceOf[Warm] then
676+
if !target.exists then
677+
println("obj.klass = " + obj.klass.show + ", field = " + field.show)
676678
assert(obj.klass.isSubClass(target.owner))
677679
if target.is(Flags.ParamAccessor) then
678680
// possible for trait parameters
@@ -1231,7 +1233,7 @@ object Semantic:
12311233
/** Utility definition used for better error-reporting of argument errors */
12321234
case class ArgInfo(value: Value, trace: Trace):
12331235
def promote: Contextual[Unit] = withTrace(trace) {
1234-
value.promote("Cannot prove the argument is fully initialized. Only fully initialized values are safe to leak.\nFound = " + value.show + ". ")
1236+
value.promote("Cannot prove the method argument is fully initialized. Only fully initialized values are safe to leak.\nFound = " + value.show + ". ")
12351237
}
12361238

12371239
/** Evaluate an expression with the given value for `this` in a given class `klass`

0 commit comments

Comments
 (0)