Skip to content

Commit 4e0e209

Browse files
committed
Merge the «declared here» diagnostics for Identifier and DeclName
1 parent bf909ca commit 4e0e209

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
@@ -1670,7 +1670,7 @@ namespace {
16701670
false)
16711671
.highlight(SourceRange(expr->getLAngleLoc(),
16721672
expr->getRAngleLoc()));
1673-
tc.diagnose(bgt->getDecl(), diag::kind_identifier_declared_here,
1673+
tc.diagnose(bgt->getDecl(), diag::kind_declname_declared_here,
16741674
DescriptiveDeclKind::GenericType, bgt->getDecl()->getName());
16751675
return Type();
16761676
}

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
@@ -1323,7 +1323,7 @@ IsObjCRequest::evaluate(Evaluator &evaluator, ValueDecl *VD) const {
13231323
proto->diagnose(diag::objc_protocol_inherits_non_objc_protocol,
13241324
proto->getDeclaredType(),
13251325
inherited->getDeclaredType());
1326-
inherited->diagnose(diag::kind_identifier_declared_here,
1326+
inherited->diagnose(diag::kind_declname_declared_here,
13271327
DescriptiveDeclKind::Protocol,
13281328
inherited->getName());
13291329
isObjC = None;

lib/Sema/TypeCheckStmt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
917917
.fixItReplace(SourceRange(targetLoc),
918918
corrections.begin()->Value->getLabelInfo().Name.str());
919919
tc.diagnose(corrections.begin()->Value->getLabelInfo().Loc,
920-
diag::identifier_declared_here,
920+
diag::decl_declared_here,
921921
corrections.begin()->Value->getLabelInfo().Name);
922922
} else {
923923
// 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)