Skip to content

Commit 4628987

Browse files
committed
[CSSimplify] InferSendableFromCaptures: Don't expect Sendable to be always present
Fixes a crash in `test/SILGen/opaque_values_silgen_lib.swift`
1 parent b17f0b5 commit 4628987

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10208,6 +10208,9 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
1020810208
// where the base type has a conditional Sendable conformance
1020910209
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
1021010210
auto shouldCheckSendabilityOfBase = [&]() {
10211+
if (!Context.getProtocol(KnownProtocolKind::Sendable))
10212+
return false;
10213+
1021110214
// Static members are always sendable because they only capture
1021210215
// metatypes which are Sendable.
1021310216
if (baseObjTy->is<AnyMetatypeType>())

0 commit comments

Comments
 (0)