Skip to content

Commit 87f41a9

Browse files
committed
[CSClosure] Check multi-statement closure attrs only in if inference is enabled
1 parent 18b23aa commit 87f41a9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Sema/CSApply.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8053,6 +8053,12 @@ namespace {
80538053

80548054
return resultTarget;
80558055
});
8056+
8057+
if (!hadError) {
8058+
TypeChecker::checkClosureAttributes(closure);
8059+
TypeChecker::checkParameterList(closure->getParameters(), closure);
8060+
}
8061+
80568062
continue;
80578063
}
80588064

lib/Sema/CSClosure.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,9 +1445,6 @@ bool ConstraintSystem::applySolutionToBody(Solution &solution,
14451445
if (application.hadError)
14461446
return true;
14471447

1448-
TypeChecker::checkClosureAttributes(closure);
1449-
TypeChecker::checkParameterList(closure->getParameters(), closure);
1450-
14511448
closure->setBodyState(ClosureExpr::BodyState::TypeCheckedWithSignature);
14521449
return false;
14531450
}

0 commit comments

Comments
 (0)