You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
function Table.method() dot-syntax declarations fail at runtime #145
Severity: High Area: Compiler — codegen.ex / scope resolver
Description
Declaring a method with dot-syntax — function Animal.new(...) — creates a new Expr.Var{name: "Animal", meta: nil} node during codegen. This node never matches any entry in var_map (whose keys are original AST nodes with non-nil meta), so the lookup returns nil, causing a runtime crash.
Reproduction
Animal= {}
functionAnimal.new(name)
return {name=name}
endreturnAnimal.new("Cat")
-- Expected: table {name="Cat"}-- Actual: ** (MatchError) no match of right hand side value: nil
Workaround
Use assignment-style method declarations:
Animal= {}
Animal.new=function(name)
return {name=name}
end
Activity
davydog187 commentedon May 4, 2026
This was fixed in PR #141 (Phase 17 — Vararg expansion, scope fixes, and suite triage).
Verified on
main(835de36):Closing as resolved.