From a34b399c3a7df49baf4c9ce6a581de5b22fe342b Mon Sep 17 00:00:00 2001 From: Mel Date: Tue, 26 May 2026 04:31:41 +0200 Subject: Support multi-level closure captures Signed-off-by: Mel --- boot/ir.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'boot/ir.c') diff --git a/boot/ir.c b/boot/ir.c index f86d63f..af631f8 100644 --- a/boot/ir.c +++ b/boot/ir.c @@ -468,6 +468,9 @@ struct Function // synthetic structure containing all captured locals. (only stateful lambdas) Type_Id capture_state_type_id; + // for nested functions this is the enclosing function. nil for top-level. + struct Function* parent_function; + // tree-side header which produced this function node. // required for synthesizing the closure type after function is lowered. struct Tree_Function_Header* ast_header; -- cgit 1.4.1