@@ -271,14 +271,16 @@ Optional<Type> ConcreteContraction::substTypeParameterRec(
271271 auto *proto = assocType->getProtocol ();
272272 auto *module = proto->getParentModule ();
273273
274+ bool allowUnavailable =
275+ !proto->isSpecificProtocol (KnownProtocolKind::Sendable);
274276 // The 'Sendable' protocol does not declare any associated types, so the
275277 // 'allowMissing' value here is actually irrelevant.
276278 auto conformance = ((*substBaseType)->isTypeParameter ()
277279 ? ProtocolConformanceRef (proto)
278280 : module ->lookupConformance (
279281 *substBaseType, proto,
280282 /* allowMissing=*/ false ,
281- /* allowUnavailable= */ false ));
283+ allowUnavailable));
282284
283285 // The base type doesn't conform, in which case the requirement remains
284286 // unsubstituted.
@@ -391,9 +393,11 @@ ConcreteContraction::substRequirement(const Requirement &req) const {
391393 if (ConcreteTypes.count (stripBoundDependentMemberTypes (firstType)) > 0 )
392394 allowMissing = true ;
393395
396+ bool allowUnavailable =
397+ !proto->isSpecificProtocol (KnownProtocolKind::Sendable);
394398 if (!substFirstType->isTypeParameter () &&
395399 !module ->lookupConformance (substFirstType, proto,
396- allowMissing, /* allowUnavailable= */ false )) {
400+ allowMissing, allowUnavailable)) {
397401 // Handle the case of <T where T : P, T : C> where C is a class and
398402 // C does not conform to P by leaving the conformance requirement
399403 // unsubstituted.
0 commit comments