Skip to content

Commit dc2392f

Browse files
committed
[CS] Remove delaying logic for callAsFunction with trailing closure
It doesn't seem like this is necessary anymore.
1 parent 977246e commit dc2392f

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13940,26 +13940,6 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyApplicableFnConstraint(
1394013940
if (instance2->isTypeVariableOrMember())
1394113941
return formUnsolved();
1394213942

13943-
auto *argumentsLoc = getConstraintLocator(
13944-
outerLocator.withPathElement(ConstraintLocator::ApplyArgument));
13945-
13946-
auto *argumentList = getArgumentList(argumentsLoc);
13947-
assert(argumentList);
13948-
13949-
// Cannot simplify construction of callable types during constraint
13950-
// generation when trailing closures are present because such calls
13951-
// have special trailing closure matching semantics. It's unclear
13952-
// whether trailing arguments belong to `.init` or implicit
13953-
// `.callAsFunction` in this case.
13954-
//
13955-
// Note that the constraint has to be activate so that solver attempts
13956-
// once constraint generation is done.
13957-
if (getPhase() == ConstraintSystemPhase::ConstraintGeneration &&
13958-
argumentList->hasAnyTrailingClosures() &&
13959-
instance2->isCallAsFunctionType(DC)) {
13960-
return formUnsolved(/*activate=*/true);
13961-
}
13962-
1396313943
// Construct the instance from the input arguments.
1396413944
auto simplified = simplifyConstructionConstraint(
1396513945
instance2, func1, subflags,

0 commit comments

Comments
 (0)