Skip to content

Commit abe6536

Browse files
author
Greg Titus
committed
Whoops, missed resetting the unexpectedState back to nil if there are additional items.
1 parent 16e1ed4 commit abe6536

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/SwiftParser/Expressions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,6 +2380,8 @@ extension Parser {
23802380
elements: [RawSyntax(caseToken)],
23812381
arena: self.arena
23822382
)
2383+
} else {
2384+
unexpectedPrePatternCase = nil
23832385
}
23842386
} while keepGoing != nil && self.hasProgressed(&loopProgress)
23852387
}

Tests/SwiftParserTest/translated/SwitchTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ final class SwitchTests: ParserTestCase {
13561356
assertParse(
13571357
"""
13581358
switch x {
1359-
case 1, 1️⃣case 2:
1359+
case 1, 1️⃣case 2, 3:
13601360
}
13611361
""",
13621362
diagnostics: [

0 commit comments

Comments
 (0)