Skip to content

Commit 8425e1c

Browse files
committed
[AST] Rename TypeCheckedAtOnce to TypeCheckedWithSignature
To clarify the meaning
1 parent 5219113 commit 8425e1c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3769,7 +3769,7 @@ class ClosureExpr : public AbstractClosureExpr {
37693769

37703770
/// The body was typechecked with the enclosing closure.
37713771
/// i.e. single expression closure or function builder closure.
3772-
TypeCheckedAtOnce,
3772+
TypeCheckedWithSignature,
37733773

37743774
/// The body was type checked separately from the enclosing closure.
37753775
SeparatelyTypeChecked,

lib/Sema/CSClosure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ SolutionApplicationToFunctionResult ConstraintSystem::applySolution(
345345
ClosureConstraintApplication application(
346346
solution, closure, closureFnType->getResult(), rewriteTarget);
347347
application.visit(fn.getBody());
348-
closure->setBodyState(ClosureExpr::BodyState::TypeCheckedAtOnce);
348+
closure->setBodyState(ClosureExpr::BodyState::TypeCheckedWithSignature);
349349

350350
return SolutionApplicationToFunctionResult::Success;
351351
}

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,7 @@ bool TypeChecker::typeCheckForEachBinding(DeclContext *dc, ForEachStmt *stmt) {
23202320
// Invalidate the pattern and the var decl.
23212321
stmt->getPattern()->setType(ErrorType::get(Context));
23222322
stmt->getPattern()->forEachVariable([&](VarDecl *var) {
2323-
if (var->hasInterfaceType() && !var->getType()->hasError())
2323+
if (var->hasInterfaceType() && !var->isInvalid())
23242324
return;
23252325
var->setInvalid();
23262326
});
@@ -2403,7 +2403,7 @@ bool TypeChecker::typeCheckConditionForStatement(LabeledConditionalStmt *stmt,
24032403
elt.getPattern()->forEachVariable([&](VarDecl *var) {
24042404
// Don't change the type of a variable that we've been able to
24052405
// compute a type for.
2406-
if (var->hasInterfaceType() && !var->getType()->hasError())
2406+
if (var->hasInterfaceType() && !var->isInvalid())
24072407
return;
24082408
var->setInvalid();
24092409
});

0 commit comments

Comments
 (0)