diff --git a/lib/SymbolGraphGen/Symbol.cpp b/lib/SymbolGraphGen/Symbol.cpp index 471f9287b1ca7..6306adcfe20da 100644 --- a/lib/SymbolGraphGen/Symbol.cpp +++ b/lib/SymbolGraphGen/Symbol.cpp @@ -801,9 +801,11 @@ AccessLevel Symbol::getEffectiveAccessLevel(const ExtensionDecl *ED) { AccessLevel maxInheritedAL = AccessLevel::Private; for (auto Inherited : ED->getInherited()) { - if (const auto *Proto = dyn_cast_or_null( - Inherited.getType()->getAnyNominal())) { - maxInheritedAL = std::max(maxInheritedAL, Proto->getFormalAccess()); + if (const auto Type = Inherited.getType()) { + if (const auto *Proto = dyn_cast_or_null( + Type->getAnyNominal())) { + maxInheritedAL = std::max(maxInheritedAL, Proto->getFormalAccess()); + } } } diff --git a/test/SourceKit/CursorInfo/cursor_symbol_graph_extensions.swift b/test/SourceKit/CursorInfo/cursor_symbol_graph_extensions.swift new file mode 100644 index 0000000000000..67f8d67311bb4 --- /dev/null +++ b/test/SourceKit/CursorInfo/cursor_symbol_graph_extensions.swift @@ -0,0 +1,13 @@ +// RUN: %sourcekitd-test -req=cursor -pos=9:28 -req-opts=retrieve_symbol_graph=1 %s -- %s + +extension ResourceRecordType { + public var debugDescription: String { + public struct HostRecord { + } + extension HostRecord: Hashable { + public struct StartOfAuthorityRecord { + public var a + } + } + } +}