Skip to content

Commit 8beda68

Browse files
committed
[astgen] Use empty param list for closures to fix crash (this will eventually need to be implemented proprly).
1 parent 2e1893f commit 8beda68

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/CASTBridging.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ void *ClosureExpr_create(void *ctx, void *body, void *dc) {
283283
SourceLoc inLoc;
284284

285285
ASTContext &Context = *static_cast<ASTContext *>(ctx);
286+
auto params = ParameterList::create(Context, inLoc, {}, inLoc);
287+
286288
auto *out = new (Context)
287289
ClosureExpr(attributes, bracketRange, nullptr, nullptr, asyncLoc,
288290
throwsLoc, arrowLoc, inLoc, nullptr, 0, (DeclContext *)dc);
289291
out->setBody((BraceStmt *)body, true);
292+
out->setParameterList(params);
290293
return (Expr *)out;
291294
}
292295

0 commit comments

Comments
 (0)