mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add missing setIsParseError() during enum case parsing
An invalid `case` construct would incorrectly return a successful status, causing `parseDecl` to crash later when it assumed there were valid decls in the `Entries` vector.
This commit is contained in:
@@ -4249,6 +4249,7 @@ ParserStatus Parser::parseDeclEnumCase(ParseDeclOptions Flags,
|
||||
// Handle the likely case someone typed 'case X, case Y'.
|
||||
if (Tok.is(tok::kw_case) && CommaLoc.isValid()) {
|
||||
diagnose(Tok, diag::expected_identifier_after_case_comma);
|
||||
Status.setIsParseError();
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user