diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 18:35:52 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 18:35:52 -0400 |
| commit | 0d489659597f9d3e6b69f92d2ca001a8dd5bf6cd (patch) | |
| tree | 2f382947025669ae0fe6e21207fd925db750f1d2 /src/compile/debuglog.c | |
| parent | 7e3e245f6809946ea06ef1998bcabb7e0902fbd7 (diff) | |
Bugfix for debug logs with functions (not closures)
Diffstat (limited to 'src/compile/debuglog.c')
| -rw-r--r-- | src/compile/debuglog.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compile/debuglog.c b/src/compile/debuglog.c index 498820ee..4128bfa7 100644 --- a/src/compile/debuglog.c +++ b/src/compile/debuglog.c @@ -97,6 +97,9 @@ Text_t compile_debug_log(env_t *env, ast_t *ast) { expr_t = lhs_t; } else if (expr_t->tag == VoidType || expr_t->tag == AbortType || expr_t->tag == ReturnType) { value_code = Texts("({", compile_statement(env, value->ast), " NULL;})"); + } else if (expr_t->tag == FunctionType) { + expr_t = Type(ClosureType, expr_t); + value_code = Texts("(Closure_t){.fn=", compile(env, value->ast), "}"); } else { value_code = compile(env, value->ast); } |
