Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/SymbolGraphGen/Symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProtocolDecl>(
Inherited.getType()->getAnyNominal())) {
maxInheritedAL = std::max(maxInheritedAL, Proto->getFormalAccess());
if (const auto Type = Inherited.getType()) {
if (const auto *Proto = dyn_cast_or_null<ProtocolDecl>(
Type->getAnyNominal())) {
maxInheritedAL = std::max(maxInheritedAL, Proto->getFormalAccess());
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions test/SourceKit/CursorInfo/cursor_symbol_graph_extensions.swift
Original file line number Diff line number Diff line change
@@ -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<IPType: IP> {
}
extension HostRecord: Hashable {
public struct StartOfAuthorityRecord {
public var a
}
}
}
}