mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
don't use null types when determining extension access level (#61227)
rdar://100169094 Co-authored-by: Max Obermeier <themomax@icloud.com>
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user