Skip to content

Commit

Permalink
Backport "SimplePattern errors should now be recovered as wildcard in…
Browse files Browse the repository at this point in the history
…stead of unimplemented expr" to 3.5.2 (#21498)

Backports #21438 to the 3.5.2 branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Aug 28, 2024
2 parents 3c6ad93 + 74cfecf commit 123ee63
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 @@ -3165,7 +3165,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 123ee63

Please sign in to comment.