Skip to content

Commit

Permalink
SimplePattern should now be recovered as wildcard instead of illegal …
Browse files Browse the repository at this point in the history
…code
  • Loading branch information
rochala committed Aug 26, 2024
1 parent 1604e77 commit f75b78d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3198,7 +3198,7 @@ object Parsers {
else {
val start = in.lastOffset
syntaxErrorOrIncomplete(IllegalStartOfSimplePattern(), expectedOffset)
errorTermTree(start)
atSpan(Span(start, in.offset)) { Ident(nme.WILDCARD) }
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/neg/i5004.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ object i0 {
1 match {
def this(): Int // error
def this()
} // error
}
}
1 change: 0 additions & 1 deletion tests/neg/parser-stability-1.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
object x0 {
x1 match // error
def this // error
// error

0 comments on commit f75b78d

Please sign in to comment.