Skip to content

Commit e19ce5a

Browse files
author
Amritpan Kaur
committed
[CSApply] Fixed type-checked subexpression output bug for multi-statement closures
1 parent 9a0978a commit e19ce5a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/Sema/CSApply.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8991,6 +8991,15 @@ ExprWalker::rewriteTarget(SolutionApplicationTarget target) {
89918991

89928992
solution.setExprTypes(resultExpr);
89938993
result.setExpr(resultExpr);
8994+
8995+
// Visit closures that have non-single expression bodies, tap expressions,
8996+
// and possibly other types of AST nodes which could only be processed
8997+
// after contextual expression.
8998+
bool hadError = processDelayed();
8999+
9000+
// If any of them failed to type check, bail.
9001+
if (hadError)
9002+
return None;
89949003

89959004
if (cs.isDebugMode()) {
89969005
auto &log = llvm::errs();
@@ -9047,15 +9056,6 @@ Optional<SolutionApplicationTarget> ConstraintSystem::applySolution(
90479056
if (!resultTarget)
90489057
return None;
90499058

9050-
// Visit closures that have non-single expression bodies, tap expressions,
9051-
// and possibly other types of AST nodes which could only be processed
9052-
// after contextual expression.
9053-
bool hadError = walker.processDelayed();
9054-
9055-
// If any of them failed to type check, bail.
9056-
if (hadError)
9057-
return None;
9058-
90599059
rewriter.finalize();
90609060

90619061
return resultTarget;

0 commit comments

Comments
 (0)