Skip to content

Commit d337765

Browse files
committed
Fix #6795: Print flagString
1 parent ea57e36 commit d337765

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class Namer { typer: Typer =>
284284
case _ => (flags.isTermFlags, flags.toTermFlags, "value")
285285
}
286286
if (!ok)
287-
ctx.error(i"modifier(s) `$flags' incompatible with $kind definition", tree.sourcePos)
287+
ctx.error(i"modifier(s) `${flags.flagsString}' incompatible with $kind definition", tree.sourcePos)
288288
adapted
289289
}
290290

tests/neg/i6795.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Error: tests/neg/i6795.scala:1:13 -----------------------------------------------------------------------------------
2+
1 |erased class Foo // error
3+
|^^^^^^^^^^^^^^^^
4+
|modifier(s) `erased' incompatible with type definition

tests/neg/i6795.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
erased class Foo // error

0 commit comments

Comments
 (0)