File tree 2 files changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/reporting
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -236,11 +236,12 @@ trait MessageRendering {
236
236
sb.append(EOL ).append(newBox())
237
237
sb.append(EOL ).append(offsetBox).append(i " Inline stack trace " )
238
238
for inlinedPos <- inlineStack if inlinedPos != pos1 do
239
- val (srcBefore, srcAfter, offset) = sourceLines(inlinedPos)
240
- val marker = positionMarker(inlinedPos)
241
239
sb.append(EOL ).append(newBox(soft = true ))
242
240
sb.append(EOL ).append(offsetBox).append(i " This location contains code that was inlined from $pos" )
243
- sb.append(EOL ).append((srcBefore ::: marker :: srcAfter).mkString(EOL ))
241
+ if inlinedPos.source.file.exists then
242
+ val (srcBefore, srcAfter, _) = sourceLines(inlinedPos)
243
+ val marker = positionMarker(inlinedPos)
244
+ sb.append(EOL ).append((srcBefore ::: marker :: srcAfter).mkString(EOL ))
244
245
sb.append(EOL ).append(endBox)
245
246
}
246
247
else sb.append(msg.message)
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ cp tests/neg/i6371/B_2.scala $OUT/B.scala
56
56
" $SBT " " scalac $OUT /A.scala -d $OUT1 "
57
57
rm $OUT /A.scala
58
58
" $SBT " " scalac -classpath $OUT1 -d $OUT1 $OUT /B.scala" > " $tmp " 2>&1 || echo " ok"
59
+ cat " $tmp " # for debugging
59
60
grep -qe " B.scala:2:7" " $tmp "
60
61
grep -qe " This location contains code that was inlined from A.scala:3" " $tmp "
61
62
You can’t perform that action at this time.
0 commit comments