Skip to content

Commit cfe5b8b

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

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
@@ -273,10 +273,13 @@ void *ClosureExpr_create(void *ctx, void *body, void *dc) {
273273
SourceLoc inLoc;
274274

275275
ASTContext &Context = *static_cast<ASTContext *>(ctx);
276+
auto params = ParameterList::create(Context, inLoc, {}, inLoc);
277+
276278
auto *out = new (Context)
277279
ClosureExpr(attributes, bracketRange, nullptr, nullptr, asyncLoc,
278280
throwsLoc, arrowLoc, inLoc, nullptr, 0, (DeclContext *)dc);
279281
out->setBody((BraceStmt *)body, true);
282+
out->setParameterList(params);
280283
return (Expr *)out;
281284
}
282285

0 commit comments

Comments
 (0)