[AST] Add a enum for type checking state of ClosureExpr's body

This commit is contained in:
Rintaro Ishizaki
2020-07-01 16:04:15 -07:00
parent 0ec7a91e38
commit b1eec26653
8 changed files with 45 additions and 22 deletions

View File

@@ -345,11 +345,13 @@ SolutionApplicationToFunctionResult ConstraintSystem::applySolution(
ClosureConstraintApplication application(
solution, closure, closureFnType->getResult(), rewriteTarget);
application.visit(fn.getBody());
closure->setBodyState(ClosureExpr::BodyState::TypeCheckedAtOnce);
return SolutionApplicationToFunctionResult::Success;
}
// Otherwise, we need to delay type checking of the closure until later.
solution.setExprTypes(closure);
closure->setBodyState(ClosureExpr::BodyState::ReadyForTypeChecking);
return SolutionApplicationToFunctionResult::Delay;
}