@@ -56,7 +56,8 @@ object Semantic:
5656 case ThisRef (klass) =>
5757 " ThisRef[" + klass.show + " ]"
5858 case Warm (klass, outer, ctor, args) =>
59- " Warm[" + klass.show + " ] { outer = " + outer.show + " , args = " + args.map(_.show).mkString(" (" , " , " , " )" ) + " }"
59+ val argsText = if args.nonEmpty then " , args = " + args.map(_.show).mkString(" (" , " , " , " )" ) else " "
60+ " Warm[" + klass.show + " ] { outer = " + outer.show + argsText + " }"
6061 case Fun (expr, thisV, klass) =>
6162 " Fun { this = " + thisV.show + " , owner = " + klass.show + " }"
6263 case RefSet (values) =>
@@ -1080,7 +1081,7 @@ object Semantic:
10801081 eval(body, thisV, klass)
10811082 }
10821083 given Trace = Trace .empty.add(body)
1083- res.promote(" The function return value is not fully initialized." )
1084+ res.promote(" The function return value is not fully initialized. Found = " + res.show + " . " )
10841085 }
10851086 if errors.nonEmpty then
10861087 reporter.report(UnsafePromotion (msg, trace.toVector, errors.head))
@@ -1124,12 +1125,12 @@ object Semantic:
11241125 withTrace(Trace .empty) {
11251126 val args = member.info.paramInfoss.flatten.map(_ => ArgInfo (Hot , Trace .empty))
11261127 val res = warm.call(member, args, receiver = NoType , superType = NoType )
1127- res.promote(" Cannot prove that the return value of " + member + " is fully initialized." )
1128+ res.promote(" Cannot prove that the return value of " + member.show + " is fully initialized. Found = " + res.show + " . " )
11281129 }
11291130 else
11301131 withTrace(Trace .empty) {
11311132 val res = warm.select(member)
1132- res.promote(" Cannot prove that the field " + member + " is fully initialized." )
1133+ res.promote(" Cannot prove that the field " + member.show + " is fully initialized. Found = " + res.show + " . " )
11331134 }
11341135 end for
11351136 end for
@@ -1230,7 +1231,7 @@ object Semantic:
12301231 /** Utility definition used for better error-reporting of argument errors */
12311232 case class ArgInfo (value : Value , trace : Trace ):
12321233 def promote : Contextual [Unit ] = withTrace(trace) {
1233- value.promote(" Cannot prove the argument is fully initialized. Only fully initialized values are safe to leak." )
1234+ value.promote(" Cannot prove the argument is fully initialized. Only fully initialized values are safe to leak. \n Found = " + value.show + " . " )
12341235 }
12351236
12361237 /** Evaluate an expression with the given value for `this` in a given class `klass`
@@ -1395,14 +1396,14 @@ object Semantic:
13951396 case Match (selector, cases) =>
13961397 val res = eval(selector, thisV, klass)
13971398 extendTrace(selector) {
1398- res.ensureHot(" The value to be matched needs to be fully initialized." )
1399+ res.ensureHot(" The value to be matched needs to be fully initialized. Found = " + res.show + " . " )
13991400 }
14001401 eval(cases.map(_.body), thisV, klass).join
14011402
14021403 case Return (expr, from) =>
14031404 val res = eval(expr, thisV, klass)
14041405 extendTrace(expr) {
1405- res.ensureHot(" return expression must be fully initialized." )
1406+ res.ensureHot(" return expression must be fully initialized. Found = " + res.show + " . " )
14061407 }
14071408
14081409 case WhileDo (cond, body) =>
0 commit comments