File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -3497,15 +3497,16 @@ void Parser::validateCollectionElement(ParserResult<Expr> element) {
3497
3497
3498
3498
auto startLocOfSubscript = subscriptExpr->getIndex ()->getStartLoc ();
3499
3499
auto endLocOfArray = arrayExpr->getEndLoc ();
3500
+ auto locForEndOfTokenArray = L->getLocForEndOfToken (SourceMgr, endLocOfArray);
3500
3501
3501
- if (L-> getLocForEndOfToken (SourceMgr, endLocOfArray) != startLocOfSubscript) {
3502
+ if (locForEndOfTokenArray != startLocOfSubscript) {
3502
3503
auto subscriptLoc = subscriptExpr->getLoc ();
3503
3504
diagnose (subscriptLoc, diag::subscript_array_element)
3504
3505
.highlight (subscriptExpr->getSourceRange ());
3505
3506
diagnose (subscriptLoc, diag::subscript_array_element_fix_it_add_comma)
3506
3507
.fixItInsertAfter (endLocOfArray, " ," );
3507
3508
diagnose (subscriptLoc, diag::subscript_array_element_fix_it_remove_space)
3508
- .fixItRemoveChars (endLocOfArray. getAdvancedLoc ( 1 ) , startLocOfSubscript);
3509
+ .fixItRemoveChars (locForEndOfTokenArray , startLocOfSubscript);
3509
3510
}
3510
3511
}
3511
3512
You can’t perform that action at this time.
0 commit comments