mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CS] Sink closure attribute/param checking into applySolution
The cases where CSApply fails should be fairly limited these days, and there doesn't seem to be any reason we shouldn't run these on failure anyway.
This commit is contained in:
@@ -8908,14 +8908,8 @@ namespace {
|
||||
/// \returns true if an error occurred.
|
||||
bool rewriteFunction(AnyFunctionRef fn) {
|
||||
switch (Rewriter.cs.applySolution(fn, *this)) {
|
||||
case SolutionApplicationToFunctionResult::Success: {
|
||||
if (auto closure =
|
||||
dyn_cast_or_null<ClosureExpr>(fn.getAbstractClosureExpr())) {
|
||||
TypeChecker::checkClosureAttributes(closure);
|
||||
TypeChecker::checkParameterList(closure->getParameters(), closure);
|
||||
}
|
||||
case SolutionApplicationToFunctionResult::Success:
|
||||
return false;
|
||||
}
|
||||
|
||||
case SolutionApplicationToFunctionResult::Failure:
|
||||
return true;
|
||||
|
||||
@@ -2573,6 +2573,9 @@ ConstraintSystem::applySolution(AnyFunctionRef fn,
|
||||
}
|
||||
|
||||
applySolutionToClosurePropertyWrappers(closure, solution);
|
||||
|
||||
TypeChecker::checkClosureAttributes(closure);
|
||||
TypeChecker::checkParameterList(closure->getParameters(), closure);
|
||||
}
|
||||
|
||||
// Enter the context of the function before performing any additional
|
||||
|
||||
Reference in New Issue
Block a user