Skip to content

Commit c56421c

Browse files
committed
[SyntaxParse] Ignore token in consecutive ID diagnostics
1 parent 9eb4c21 commit c56421c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3468,7 +3468,8 @@ void Parser::diagnoseConsecutiveIDs(StringRef First, SourceLoc FirstLoc,
34683468

34693469
diagnose(Tok, diag::repeated_identifier, DeclKindName);
34703470
auto Second = Tok.getText();
3471-
auto SecondLoc = consumeToken();
3471+
auto SecondLoc = Tok.getLoc();
3472+
ignoreToken();
34723473

34733474
SourceRange FixRange(FirstLoc, SecondLoc);
34743475
// Provide two fix-its: a direct concatenation of the two identifiers

test/Syntax/round_trip_misc.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ do {
2828
do {
2929
typealias Alias = A & B & C.D<>
3030
}
31+
do {
32+
typealias boo bar = Int
33+
}
3134

3235
// Orphan '}' at top level
3336
}

0 commit comments

Comments
 (0)