Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Severity: High
Area: Compiler — codegen.ex
Description
local function name() ... end (i.e., Statement.LocalFunc AST nodes) has no codegen handler. The catch-all defp gen_statement(_stmt, ctx), do: {[], ctx} silently discards the declaration — no instructions are emitted and no error is raised.
Reproduction
local function add(a, b)
return a + b
end
return add(1, 2)
-- Expected: 3
-- Actual: runtime error — "add" is nilWorkaround
Use a regular (global) function declaration or an assignment:
function add(a, b) -- global
return a + b
end
local add = function(a, b) -- explicit assignment
return a + b
endMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
davydog187 commentedon May 4, 2026
This was fixed in #137 (Phase 11 — Compiler Fundamentals).
Verified on
main(835de36):Closing as resolved. Future regressions are tracked via the suite-status CI job and the .agents/plans/ workflow.