File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/reporting Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -236,11 +236,12 @@ trait MessageRendering {
236236 sb.append(EOL ).append(newBox())
237237 sb.append(EOL ).append(offsetBox).append(i " Inline stack trace " )
238238 for inlinedPos <- inlineStack if inlinedPos != pos1 do
239- val (srcBefore, srcAfter, offset) = sourceLines(inlinedPos)
240- val marker = positionMarker(inlinedPos)
241239 sb.append(EOL ).append(newBox(soft = true ))
242240 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 ))
244245 sb.append(EOL ).append(endBox)
245246 }
246247 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
5656" $SBT " " scalac $OUT /A.scala -d $OUT1 "
5757rm $OUT /A.scala
5858" $SBT " " scalac -classpath $OUT1 -d $OUT1 $OUT /B.scala" > " $tmp " 2>&1 || echo " ok"
59+ cat " $tmp " # for debugging
5960grep -qe " B.scala:2:7" " $tmp "
6061grep -qe " This location contains code that was inlined from A.scala:3" " $tmp "
6162
You can’t perform that action at this time.
0 commit comments