[ConstraintSystem] Skip sendability check for static members

Such members only capture base metatatypes which are themselves
always sendable.
This commit is contained in:
Pavel Yaskevich
2024-02-26 10:28:18 -08:00
parent 03194eb4b1
commit 7c0bb41573
3 changed files with 23 additions and 5 deletions

View File

@@ -2806,7 +2806,9 @@ ConstraintSystem::getTypeOfMemberReference(
FunctionType::ExtInfo info;
if (Context.LangOpts.hasFeature(Feature::InferSendableFromCaptures)) {
if (isPartialApplication(locator) && baseOpenedTy->isSendableType()) {
if (isPartialApplication(locator) &&
(resolvedBaseTy->is<AnyMetatypeType>() ||
baseOpenedTy->isSendableType())) {
// Add @Sendable to functions without conditional conformances
functionType =
functionType