Skip to content

Commit da3cef2

Browse files
committed
[ResultBuilders] Fix a crash in PreCheckResultBuilderApplication
Cant assume that `shouldTypeCheckInEnclosingExpression` always implies a single expression closure anymore.
1 parent fed705d commit da3cef2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/BuilderTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,7 @@ class PreCheckResultBuilderApplication : public ASTWalker {
19701970
return nullptr;
19711971

19721972
if (auto *closure = dyn_cast<ClosureExpr>(expr)) {
1973-
if (shouldTypeCheckInEnclosingExpression(closure)) {
1973+
if (closure->hasSingleExpressionBody()) {
19741974
hasError |= containsErrorExpr(closure->getSingleExpressionBody());
19751975
return hasError ? nullptr : expr;
19761976
}

0 commit comments

Comments
 (0)