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 LTS (#22110)

Backports #21438 to the 3.3.5.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Dec 4, 2024
2 parents dc70647 + 72bce19 commit 2271639
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 @@ -3035,7 +3035,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 2271639

Please sign in to comment.