Skip to content

Commit 7b1730b

Browse files
committed
Revert "[ProtocolConformance] Compute the correct un-availability for inherited"
This reverts commit e2ddc6c.
1 parent 41ec46a commit 7b1730b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/AST/ProtocolConformanceRef.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ bool ProtocolConformanceRef::hasUnavailableConformance() const {
333333

334334
// Check whether this conformance is on an unavailable extension.
335335
auto concrete = getConcrete();
336-
auto *dc = concrete->getRootConformance()->getDeclContext();
337-
auto ext = dyn_cast<ExtensionDecl>(dc);
336+
auto ext = dyn_cast<ExtensionDecl>(concrete->getDeclContext());
338337
if (ext && AvailableAttr::isUnavailable(ext))
339338
return true;
340339

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6773,6 +6773,9 @@ ProtocolConformance *swift::deriveImplicitSendableConformance(
67736773
auto inheritedConformance = checkConformance(
67746774
classDecl->mapTypeIntoContext(superclass),
67756775
proto, /*allowMissing=*/false);
6776+
if (inheritedConformance.hasUnavailableConformance())
6777+
inheritedConformance = ProtocolConformanceRef::forInvalid();
6778+
67766779
if (inheritedConformance) {
67776780
inheritedConformance = inheritedConformance
67786781
.mapConformanceOutOfContext();

0 commit comments

Comments
 (0)