Skip to content

Commit 2b6ffb5

Browse files
committed
[Sema] Remove on-demand type checking for return type of ClosureExpr
Closure singatures should be type checked at that point anyway.
1 parent 6cbdca4 commit 2b6ffb5

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

lib/Sema/TypeCheckStmt.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,6 @@ class StmtChecker : public StmtVisitor<StmtChecker, Stmt*> {
431431
return nullptr;
432432
}
433433

434-
// Try type checking the closure if it hasn't.
435-
if (auto *closure = TheFunc->getAbstractClosureExpr()) {
436-
if (!closure->getType() && !closure->hasSingleExpressionBody())
437-
swift::typeCheckASTNodeAtLoc(closure->getParent(), closure->getLoc());
438-
}
439-
440434
Type ResultTy = TheFunc->getBodyResultType();
441435
if (!ResultTy || ResultTy->hasError())
442436
return nullptr;

0 commit comments

Comments
 (0)