Skip to content

Commit 783a572

Browse files
committed
Compute captures of REPL closures
REPLChecker::generatePrintOfExpression() type-checked the closures it generated, but did not add them to the ClosuresWithUncomputedCaptures list.
1 parent ab96afa commit 783a572

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Sema/TypeCheckREPL.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ void REPLChecker::generatePrintOfExpression(StringRef NameStr, Expr *E) {
270270
BraceStmt *Body = builder.createBodyStmt(Loc, EndLoc);
271271
CE->setBody(Body, false);
272272
TC.typeCheckClosureBody(CE);
273+
TC.ClosuresWithUncomputedCaptures.push_back(CE);
273274

274275
auto *TheCall = CallExpr::createImplicit(Context, CE, { E }, { });
275276
TheCall->getArg()->setType(AnyFunctionType::composeInput(Context, args, false));

0 commit comments

Comments
 (0)