From: Brendan Hansen Date: Mon, 24 Apr 2023 01:56:23 +0000 (-0500) Subject: bugfix: detecting potential closures in nested polymorph lookups X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=16792f70848e552f5be9d96aded391ac9170eb77;p=onyx.git bugfix: detecting potential closures in nested polymorph lookups --- diff --git a/compiler/src/clone.c b/compiler/src/clone.c index fc94a293..0bcdd608 100644 --- a/compiler/src/clone.c +++ b/compiler/src/clone.c @@ -524,7 +524,7 @@ AstNode* ast_clone(bh_allocator a, void* n) { df->scope_to_lookup_captured_values = NULL; } - if (clone_depth > 1) { + if (clone_depth > 1 && captured_entities) { sf->flags |= Ast_Flag_Function_Is_Lambda_Inside_PolyProc; df->flags &= ~Ast_Flag_Function_Is_Lambda_Inside_PolyProc; E(df);