Skip to content

Commit 13e805e

Browse files
AnthonyLatsisjrose-apple
authored andcommitted
Merge the «declared here» diagnostics for Identifier and DeclName (#23703)
1 parent 94f7706 commit 13e805e

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@
3939

4040
NOTE(kind_declname_declared_here,none,
4141
"%0 %1 declared here", (DescriptiveDeclKind, DeclName))
42-
NOTE(kind_identifier_declared_here,none,
43-
"%0 %1 declared here", (DescriptiveDeclKind, Identifier))
4442
NOTE(decl_declared_here,none,
4543
"%0 declared here", (DeclName))
46-
NOTE(identifier_declared_here,none,
47-
"%0 declared here", (Identifier))
4844
NOTE(kind_declared_here,none,
4945
"%0 declared here", (DescriptiveDeclKind))
5046
NOTE(implicit_member_declared_here,none,

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ namespace {
16161616
false)
16171617
.highlight(SourceRange(expr->getLAngleLoc(),
16181618
expr->getRAngleLoc()));
1619-
tc.diagnose(bgt->getDecl(), diag::kind_identifier_declared_here,
1619+
tc.diagnose(bgt->getDecl(), diag::kind_declname_declared_here,
16201620
DescriptiveDeclKind::GenericType, bgt->getDecl()->getName());
16211621
return Type();
16221622
}

lib/Sema/TypeCheckDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static void checkCircularity(TypeChecker &tc, T *decl,
597597
tc.diagnose(decl->getLoc(), circularDiag,
598598
(*cycleStart)->getName());
599599
for (auto i = cycleStart + 1, iEnd = path.end(); i != iEnd; ++i) {
600-
tc.diagnose(*i, diag::kind_identifier_declared_here,
600+
tc.diagnose(*i, diag::kind_declname_declared_here,
601601
declKind, (*i)->getName());
602602
}
603603

lib/Sema/TypeCheckDeclObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ IsObjCRequest::evaluate(Evaluator &evaluator, ValueDecl *VD) const {
13781378
proto->diagnose(diag::objc_protocol_inherits_non_objc_protocol,
13791379
proto->getDeclaredType(),
13801380
inherited->getDeclaredType());
1381-
inherited->diagnose(diag::kind_identifier_declared_here,
1381+
inherited->diagnose(diag::kind_declname_declared_here,
13821382
DescriptiveDeclKind::Protocol,
13831383
inherited->getName());
13841384
isObjC = None;

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
923923
.fixItReplace(SourceRange(targetLoc),
924924
corrections.begin()->Value->getLabelInfo().Name.str());
925925
tc.diagnose(corrections.begin()->Value->getLabelInfo().Loc,
926-
diag::identifier_declared_here,
926+
diag::decl_declared_here,
927927
corrections.begin()->Value->getLabelInfo().Name);
928928
} else {
929929
// If we have multiple corrections or none, produce a generic diagnostic

lib/Sema/TypeCheckType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ Type TypeChecker::applyGenericArguments(Type type,
708708
genericParams->size(), genericArgs.size(),
709709
genericArgs.size() < genericParams->size())
710710
.highlight(generic->getAngleBrackets());
711-
decl->diagnose(diag::kind_identifier_declared_here,
711+
decl->diagnose(diag::kind_declname_declared_here,
712712
DescriptiveDeclKind::GenericType, decl->getName());
713713
}
714714
return ErrorType::get(ctx);
@@ -898,7 +898,7 @@ static void diagnoseUnboundGenericType(Type ty, SourceLoc loc) {
898898
diag.fixItInsertAfter(loc, genericArgsToAdd);
899899
}
900900
}
901-
unbound->getDecl()->diagnose(diag::kind_identifier_declared_here,
901+
unbound->getDecl()->diagnose(diag::kind_declname_declared_here,
902902
DescriptiveDeclKind::GenericType,
903903
unbound->getDecl()->getName());
904904
}

0 commit comments

Comments
 (0)