@@ -237,10 +237,16 @@ GenericSignature ProtocolConformance::getGenericSignature() const {
237
237
case ProtocolConformanceKind::Self:
238
238
// If we have a normal or inherited protocol conformance, look for its
239
239
// generic signature.
240
+
241
+ // In -swift-version 5 mode, a conditional conformance to a protocol can imply
242
+ // a Sendable conformance. The implied conformance is unconditional so it uses
243
+ // the generic signature of the nominal type and not the generic signature of
244
+ // the extension that declared the (implying) conditional conformance.
240
245
if (getSourceKind () == ConformanceEntryKind::Implied &&
241
246
getProtocol ()->isSpecificProtocol (KnownProtocolKind::Sendable)) {
242
247
return getDeclContext ()->getSelfNominalTypeDecl ()->getGenericSignature ();
243
248
}
249
+
244
250
return getDeclContext ()->getGenericSignatureOfContext ();
245
251
246
252
case ProtocolConformanceKind::Builtin:
@@ -416,6 +422,10 @@ ConditionalRequirementsRequest::evaluate(Evaluator &evaluator,
416
422
return {};
417
423
}
418
424
425
+ // In -swift-version 5 mode, a conditional conformance to a protocol can imply
426
+ // a Sendable conformance. We ask the conformance for its generic signature,
427
+ // which will always be the generic signature of `ext` except in this case,
428
+ // where it's the generic signature of the extended nominal.
419
429
const auto extensionSig = NPC->getGenericSignature ();
420
430
421
431
// The extension signature should be a superset of the type signature, meaning
0 commit comments