diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 8928285603c4..f267f44c168b 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -3165,7 +3165,7 @@ object Parsers { else { val start = in.lastOffset syntaxErrorOrIncomplete(IllegalStartOfSimplePattern(), expectedOffset) - errorTermTree(start) + atSpan(Span(start, in.offset)) { Ident(nme.WILDCARD) } } } diff --git a/tests/neg/i5004.scala b/tests/neg/i5004.scala index 02105104efd1..ba1abe77f5bf 100644 --- a/tests/neg/i5004.scala +++ b/tests/neg/i5004.scala @@ -2,5 +2,5 @@ object i0 { 1 match { def this(): Int // error def this() -} // error +} } diff --git a/tests/neg/parser-stability-1.scala b/tests/neg/parser-stability-1.scala index 661ab87e31e5..560b9cf116e3 100644 --- a/tests/neg/parser-stability-1.scala +++ b/tests/neg/parser-stability-1.scala @@ -1,4 +1,3 @@ object x0 { x1 match // error def this // error -// error \ No newline at end of file