File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -875,21 +875,23 @@ static void formatDiagnosticArgument(StringRef Modifier,
875
875
}
876
876
877
877
if (includeName) {
878
- // If it's an accessor, describe that and then switch to discussing its
879
- // storage.
880
878
if (auto accessor = dyn_cast<AccessorDecl>(D)) {
879
+ // If it's an accessor, describe that and then switch to discussing its
880
+ // storage declaration.
881
881
Out << Decl::getDescriptiveKindName (D->getDescriptiveKind ()) << " for " ;
882
882
D = accessor->getStorage ();
883
+ } else if (auto ext = dyn_cast<ExtensionDecl>(D)) {
884
+ // If it's an extension with a valid bound type declaration, describe
885
+ // the extension itself then switch to discussing the bound
886
+ // declaration.
887
+ if (auto *nominal = ext->getSelfNominalTypeDecl ()) {
888
+ Out << Decl::getDescriptiveKindName (D->getDescriptiveKind ())
889
+ << " of " ;
890
+ D = nominal;
891
+ }
883
892
}
884
893
}
885
894
886
- // If it's an extension, describe that and then switch to discussing its
887
- // nominal type.
888
- if (auto ext = dyn_cast<ExtensionDecl>(D)) {
889
- Out << Decl::getDescriptiveKindName (D->getDescriptiveKind ()) << " of " ;
890
- D = ext->getSelfNominalTypeDecl ();
891
- }
892
-
893
895
// Figure out the name we want to print.
894
896
DeclName name;
895
897
if (includeName) {
You can’t perform that action at this time.
0 commit comments