mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix the source ranges of ill-formed precedence groups.
rdar://problem/27662943
This commit is contained in:
@@ -5684,6 +5684,11 @@ Parser::parseDeclPrecedenceGroup(ParseDeclOptions flags,
|
||||
return result;
|
||||
};
|
||||
auto createInvalid = [&] {
|
||||
// Use the last consumed token location as the rbrace to satisfy
|
||||
// the AST invariant about a decl's source range including all of
|
||||
// its components.
|
||||
if (!rbraceLoc.isValid()) rbraceLoc = PreviousLoc;
|
||||
|
||||
auto result = create();
|
||||
result->setInvalid();
|
||||
return makeParserErrorResult(result);
|
||||
|
||||
Reference in New Issue
Block a user