Skip to content

Commit 0b28615

Browse files
committed
[Diag] Diagnostic adjustment for special DeclNames
The diagnostic warn_unqualified_access cannot exist with special DeclNames and shall thus take an Identifier as parameter
1 parent 1803c04 commit 0b28615

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,7 @@ NOTE(add_self_to_type,none,
26182618

26192619
WARNING(warn_unqualified_access,none,
26202620
"use of %0 treated as a reference to %1 in %2 %3",
2621-
(DeclBaseName, DescriptiveDeclKind, DescriptiveDeclKind, DeclName))
2621+
(Identifier, DescriptiveDeclKind, DescriptiveDeclKind, DeclName))
26222622
NOTE(fix_unqualified_access_member,none,
26232623
"use 'self.' to silence this warning", ())
26242624
NOTE(fix_unqualified_access_top_level,none,

lib/Sema/MiscDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
728728
}
729729

730730
TC.diagnose(DRE->getLoc(), diag::warn_unqualified_access,
731-
VD->getBaseName(), VD->getDescriptiveKind(),
731+
VD->getBaseName().getIdentifier(), VD->getDescriptiveKind(),
732732
declParent->getDescriptiveKind(), declParent->getFullName());
733733
TC.diagnose(VD, diag::decl_declared_here, VD->getFullName());
734734

0 commit comments

Comments
 (0)