Skip to content

Commit c6c6426

Browse files
committed
Display primary error message before multi-span error
1 parent 6c4d730 commit c6c6426

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ trait MessageRendering {
313313
val posString = posStr(pos1, msg, diagnosticLevel(dia))
314314
if posString.nonEmpty then sb.append(posString).append(EOL)
315315

316+
// Display primary error message before code snippet
317+
sb.append(msg.message)
318+
if !msg.message.endsWith(EOL) then sb.append(EOL)
319+
316320
// Render the unified code snippet
317321
// Get syntax-highlighted content for the entire range
318322
val startOffset = source.lineToOffset(minLine)

0 commit comments

Comments
 (0)