Skip to content

Commit b66aed3

Browse files
committed
[ProtocolConformance] Compute the correct un-availability for inherited
conformances. (cherry picked from commit e2ddc6c)
1 parent e28670d commit b66aed3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/AST/ProtocolConformanceRef.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ bool ProtocolConformanceRef::hasUnavailableConformance() const {
287287

288288
// Check whether this conformance is on an unavailable extension.
289289
auto concrete = getConcrete();
290-
auto ext = dyn_cast<ExtensionDecl>(concrete->getDeclContext());
290+
auto *dc = concrete->getRootConformance()->getDeclContext();
291+
auto ext = dyn_cast<ExtensionDecl>(dc);
291292
if (ext && AvailableAttr::isUnavailable(ext))
292293
return true;
293294

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6464,9 +6464,6 @@ ProtocolConformance *swift::deriveImplicitSendableConformance(
64646464
auto inheritedConformance = classModule->checkConformance(
64656465
classDecl->mapTypeIntoContext(superclass),
64666466
proto, /*allowMissing=*/false);
6467-
if (inheritedConformance.hasUnavailableConformance())
6468-
inheritedConformance = ProtocolConformanceRef::forInvalid();
6469-
64706467
if (inheritedConformance) {
64716468
inheritedConformance = inheritedConformance
64726469
.mapConformanceOutOfContext();

0 commit comments

Comments
 (0)