Skip to content

Commit a810908

Browse files
committed
[Parse] Drop Swift3 support for '$' as an identifier
Swift3 used to parse '$' as an identifier without digagnostics. Related 6accc59
1 parent abc44ef commit a810908

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/Parse/Lexer.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -895,13 +895,9 @@ void Lexer::lexDollarIdent() {
895895
}
896896

897897
if (CurPtr == tokStart + 1) {
898-
// It is always an error to see a standalone '$' when not in Swift 3
899-
// compatibility mode.
900-
if (!LangOpts.isSwiftVersion3()) {
901-
// Offer to replace '$' with '`$`'.
902-
diagnose(tokStart, diag::standalone_dollar_identifier)
903-
.fixItReplaceChars(getSourceLoc(tokStart), getSourceLoc(CurPtr), "`$`");
904-
}
898+
// It is an error to see a standalone '$'. Offer to replace '$' with '`$`'.
899+
diagnose(tokStart, diag::standalone_dollar_identifier)
900+
.fixItReplaceChars(getSourceLoc(tokStart), getSourceLoc(CurPtr), "`$`");
905901
return formToken(tok::identifier, tokStart);
906902
}
907903

0 commit comments

Comments
 (0)