Problem
Found while linting pslua-generated Lua in a downstream application (OpenResty, with luacheck and lua-language-server). Cosmetic only: the code runs and passes luac -p. Re-confirmed on current main.
Dictionaries for method-less classes (Prim.Row.Cons, Prim.RowList.RowToList, and similar) are emitted as empty tables and passed to call sites that never read them. An example is a dispatchCons slot receiving an empty Row.Cons dictionary in RowToList-driven dispatch. No pass erases empty dictionaries or the parameters bound to them, so they ride through as inert {} values.
Approach
Erase parameters bound to provably zero-method dictionaries and drop the matching call-site arguments.
Prerequisites / Relations
Overlaps with #273 (shared unused-parameter / dead-argument handling; non-blocking).
Verification / Measurement
The RowToList-driven dispatchCons example no longer receives an empty Row.Cons dictionary argument; generated output still passes luac -p. Low priority: a handful of dead arguments.
Problem
Found while linting pslua-generated Lua in a downstream application (OpenResty, with luacheck and lua-language-server). Cosmetic only: the code runs and passes
luac -p. Re-confirmed on currentmain.Dictionaries for method-less classes (
Prim.Row.Cons,Prim.RowList.RowToList, and similar) are emitted as empty tables and passed to call sites that never read them. An example is adispatchConsslot receiving an emptyRow.Consdictionary inRowToList-driven dispatch. No pass erases empty dictionaries or the parameters bound to them, so they ride through as inert{}values.Approach
Erase parameters bound to provably zero-method dictionaries and drop the matching call-site arguments.
Prerequisites / Relations
Overlaps with #273 (shared unused-parameter / dead-argument handling; non-blocking).
Verification / Measurement
The
RowToList-drivendispatchConsexample no longer receives an emptyRow.Consdictionary argument; generated output still passesluac -p. Low priority: a handful of dead arguments.