[CS] Remove delaying logic for callAsFunction with trailing closure

It doesn't seem like this is necessary anymore.
This commit is contained in:
Hamish Knight
2025-10-19 13:14:00 +01:00
parent 977246e0da
commit dc2392f597

View File

@@ -13940,26 +13940,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyApplicableFnConstraint(
if (instance2->isTypeVariableOrMember())
return formUnsolved();
auto *argumentsLoc = getConstraintLocator(
outerLocator.withPathElement(ConstraintLocator::ApplyArgument));
auto *argumentList = getArgumentList(argumentsLoc);
assert(argumentList);
// Cannot simplify construction of callable types during constraint
// generation when trailing closures are present because such calls
// have special trailing closure matching semantics. It's unclear
// whether trailing arguments belong to `.init` or implicit
// `.callAsFunction` in this case.
//
// Note that the constraint has to be activate so that solver attempts
// once constraint generation is done.
if (getPhase() == ConstraintSystemPhase::ConstraintGeneration &&
argumentList->hasAnyTrailingClosures() &&
instance2->isCallAsFunctionType(DC)) {
return formUnsolved(/*activate=*/true);
}
// Construct the instance from the input arguments.
auto simplified = simplifyConstructionConstraint(
instance2, func1, subflags,