Skip to content

Tolerate missing Sendable conformances on superclasses. #40801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/AST/ConformanceLookupTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,8 @@ ConformanceLookupTable::getConformance(NominalTypeDecl *nominal,

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

// Form the inherited conformance.
entry->Conformance =
Expand Down
3 changes: 2 additions & 1 deletion lib/AST/Module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,8 @@ LookupConformanceInModuleRequest::evaluate(
auto superclassTy = type->getSuperclassForDecl(conformingClass);

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

Expand Down
5 changes: 5 additions & 0 deletions test/Concurrency/sendable_conformance_checking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,8 @@ actor A10: AsyncThrowingProtocolWithNotSendable {
}
}
}

// rdar://86653457 - Crash due to missing Sendable conformances.
class Klass<Output: Sendable>: Sendable {}
final class SubKlass: Klass<[S]> {}
public struct S {}