Skip to content

Commit e2ddc6c

Browse files
committed
[ProtocolConformance] Compute the correct un-availability for inherited
conformances.
1 parent b139770 commit e2ddc6c

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
@@ -288,7 +288,8 @@ bool ProtocolConformanceRef::hasUnavailableConformance() const {
288288

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

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6249,9 +6249,6 @@ ProtocolConformance *swift::deriveImplicitSendableConformance(
62496249
auto inheritedConformance = ModuleDecl::checkConformance(
62506250
classDecl->mapTypeIntoContext(superclass),
62516251
proto, /*allowMissing=*/false);
6252-
if (inheritedConformance.hasUnavailableConformance())
6253-
inheritedConformance = ProtocolConformanceRef::forInvalid();
6254-
62556252
if (inheritedConformance) {
62566253
inheritedConformance = inheritedConformance
62576254
.mapConformanceOutOfContext();

0 commit comments

Comments
 (0)