-
Notifications
You must be signed in to change notification settings - Fork 8
Open
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
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working