Skip to content

Commit f09752a

Browse files
authored
Merge pull request #40801 from DougGregor/missing-inherited-conformance
Tolerate missing Sendable conformances on superclasses.
2 parents 77f4dfa + 5023a93 commit f09752a

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

lib/AST/ConformanceLookupTable.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,8 @@ ConformanceLookupTable::getConformance(NominalTypeDecl *nominal,
851851

852852
// Look up the inherited conformance.
853853
ModuleDecl *module = entry->getDeclContext()->getParentModule();
854-
auto inheritedConformance = module->lookupConformance(superclassTy,
855-
protocol);
854+
auto inheritedConformance = module->lookupConformance(
855+
superclassTy, protocol, /*allowMissing=*/true);
856856

857857
// Form the inherited conformance.
858858
entry->Conformance =

lib/AST/Module.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,8 @@ LookupConformanceInModuleRequest::evaluate(
12871287
auto superclassTy = type->getSuperclassForDecl(conformingClass);
12881288

12891289
// Compute the conformance for the inherited type.
1290-
auto inheritedConformance = mod->lookupConformance(superclassTy, protocol);
1290+
auto inheritedConformance = mod->lookupConformance(
1291+
superclassTy, protocol, /*allowMissing=*/true);
12911292
assert(inheritedConformance &&
12921293
"We already found the inherited conformance");
12931294

test/Concurrency/sendable_conformance_checking.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,8 @@ actor A10: AsyncThrowingProtocolWithNotSendable {
145145
}
146146
}
147147
}
148+
149+
// rdar://86653457 - Crash due to missing Sendable conformances.
150+
class Klass<Output: Sendable>: Sendable {}
151+
final class SubKlass: Klass<[S]> {}
152+
public struct S {}

0 commit comments

Comments
 (0)