Merge pull request #79478 from xedin/sendable-completion-handler-fixes

[TypeChecker/NameLookup] SE-0463: A few fixes for `SendableCompletionHandlers` feature
This commit is contained in:
Pavel Yaskevich
2025-03-04 09:34:10 -08:00
committed by GitHub
9 changed files with 355 additions and 89 deletions

View File

@@ -331,9 +331,14 @@ void ConstraintSystem::recordAppliedDisjunction(
/// Retrieve a dynamic result signature for the given declaration.
static std::tuple<char, ObjCSelector, CanType>
getDynamicResultSignature(ValueDecl *decl) {
// Handle functions.
if (auto func = dyn_cast<AbstractFunctionDecl>(decl)) {
// Handle functions.
auto type = func->getMethodInterfaceType();
// Strip `@Sendable` and `any Sendable` because it should be
// possible to add them without affecting lookup results and
// shadowing. All of the declarations that are processed here
// are `@objc` and hence `@preconcurrency`.
auto type = func->getMethodInterfaceType()->stripConcurrency(
/*recursive=*/true, /*dropGlobalActor=*/false);
return std::make_tuple(func->isStatic(), func->getObjCSelector(),
type->getCanonicalType());
}