Skip to content

Commit d5f4268

Browse files
committed
Error message for illegal self type (#1424)
Remove debug info from error message.
1 parent d2120ca commit d5f4268

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ object Parsers {
296296
case Typed(Ident(name), tpt) =>
297297
makeParameter(name.asTermName, tpt, mods) withPos tree.pos
298298
case _ =>
299-
syntaxError(s"not a legal $expected (${tree.getClass})", tree.pos)
299+
syntaxError(s"not a legal $expected", tree.pos)
300300
makeParameter(nme.ERROR, tree, mods)
301301
}
302302

tests/neg/i1424.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Test {
2+
(x: Int) => x // error: not a legal self type clause // error: package x is not a value // error: package x is not a value
3+
}

0 commit comments

Comments
 (0)