Skip to content

Commit 0316d8c

Browse files
committed
Update error message header
1 parent 8e3f163 commit 0316d8c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ trait MessageRendering {
114114
*/
115115
def posStr(pos: SourcePosition, diagnosticLevel: String, message: Message)(implicit ctx: Context): String =
116116
if (pos.exists) hl(diagnosticLevel)({
117+
val pos1 = pos.nonInlined
117118
val file =
118-
if (pos.source.file.exists) s"${pos.source.file.toString}:${pos.line + 1}:${pos.column}"
119-
else s"${pos.source.file.toString}: offset ${pos.start} (missing source file)"
119+
s"${pos1.source.file.toString}:${pos1.line + 1}:${pos1.column}"
120120
val errId =
121121
if (message.errorId ne ErrorMessageID.NoExplanationID) {
122122
val errorNumber = message.errorId.errorNumber

tests/neg/cannot-reduce-inline-match.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Error: tests/neg/cannot-reduce-inline-match.scala:3:13 --------------------------------------------------------------
1+
-- Error: tests/neg/cannot-reduce-inline-match.scala:9:5 ---------------------------------------------------------------
22
9 | foo("f") // error
33
| ^^^^^^^^
44
| cannot reduce inline match with

tests/neg/inline-error-pos.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- Error: tests/neg/inline-error-pos.scala:3:11 ------------------------------------------------------------------------
1+
-- Error: tests/neg/inline-error-pos.scala:8:13 ------------------------------------------------------------------------
22
8 | val b = foo(2) // error
33
| ^^^^^^
44
| cannot reduce inline match with

0 commit comments

Comments
 (0)