Skip to content

Commit b175165

Browse files
authored
Merge pull request #42382 from CodaFi/redress
[NFC] Remove Legacy Parser-Based Redeclaration Diagnostics
2 parents 155cd2e + 2453211 commit b175165

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

include/swift/AST/DiagnosticsCommon.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ ERROR(cannot_parse_group_info_file,none,
3838
ERROR(error_no_group_info,none,
3939
"no group info found for file: '%0'", (StringRef))
4040

41-
NOTE(previous_decldef,none,
42-
"previous definition of %0 is here", (DeclBaseName))
43-
4441
NOTE(brace_stmt_suggest_do,none,
4542
"did you mean to use a 'do' statement?", ())
4643

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ ERROR(number_cant_start_decl_name,none,
219219
(StringRef))
220220
ERROR(expected_identifier_after_case_comma, PointsToFirstBadToken,
221221
"expected identifier after comma in enum 'case' declaration", ())
222-
ERROR(decl_redefinition,none,
223-
"definition conflicts with previous value", ())
224222
ERROR(let_cannot_be_computed_property,none,
225223
"'let' declarations cannot be computed properties", ())
226224
ERROR(let_cannot_be_observing_property,none,

include/swift/Parse/Parser.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,7 @@ class Parser {
784784
return diagnose(Tok.getLoc(),
785785
Diagnostic(DiagID, std::forward<ArgTypes>(Args)...));
786786
}
787-
788-
void diagnoseRedefinition(ValueDecl *Prev, ValueDecl *New);
789-
787+
790788
/// Add a fix-it to remove the space in consecutive identifiers.
791789
/// Add a camel-cased option if it is different than the first option.
792790
void diagnoseConsecutiveIDs(StringRef First, SourceLoc FirstLoc,

lib/Parse/Parser.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,15 +1159,6 @@ Parser::parseList(tok RightK, SourceLoc LeftLoc, SourceLoc &RightLoc,
11591159
return Status;
11601160
}
11611161

1162-
/// diagnoseRedefinition - Diagnose a redefinition error, with a note
1163-
/// referring back to the original definition.
1164-
1165-
void Parser::diagnoseRedefinition(ValueDecl *Prev, ValueDecl *New) {
1166-
assert(New != Prev && "Cannot conflict with self");
1167-
diagnose(New->getLoc(), diag::decl_redefinition);
1168-
diagnose(Prev->getLoc(), diag::previous_decldef, Prev->getBaseName());
1169-
}
1170-
11711162
Optional<StringRef>
11721163
Parser::getStringLiteralIfNotInterpolated(SourceLoc Loc,
11731164
StringRef DiagText) {

0 commit comments

Comments
 (0)