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.
Instance methods whose parameters are unused emit a function with fewer parameters than the class-method call site passes. The canonical case is IsSymbol: for a concrete symbol the instance is reflectSymbol _ = "tail", which compiles to a zero-parameter function, while the call site keeps the uniform convention and passes the Proxy:
reflectSymbol = function() return "tail" end -- definition: 0 params
-- …
local key = dictIsSymbol.reflectSymbol(Type_Proxy_Proxy) -- call site: 1 arg
Lua discards the extra argument, so this runs fine, but lua-language-server flags redundant-parameter at every such call site, and there are many. Present in the Golden.GenericEqTwoTypes and Golden.BugListGenericEq output. Low priority, language-server noise only.
Approach
Either keep a placeholder _ parameter so the definition arity matches the call convention, or narrow the call site to the real arity.
Prerequisites / Relations
Relates to #275 (shared unused-parameter / dead-argument handling; non-blocking).
Verification / Measurement
lua-language-server reports no redundant-parameter on the affected golden outputs (Golden.GenericEqTwoTypes, Golden.BugListGenericEq).
Open questions
Which fix direction to take: a placeholder _ parameter on the definition, or narrowing the call site to the real arity.
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.Instance methods whose parameters are unused emit a function with fewer parameters than the class-method call site passes. The canonical case is
IsSymbol: for a concrete symbol the instance isreflectSymbol _ = "tail", which compiles to a zero-parameter function, while the call site keeps the uniform convention and passes theProxy:Lua discards the extra argument, so this runs fine, but lua-language-server flags
redundant-parameterat every such call site, and there are many. Present in theGolden.GenericEqTwoTypesandGolden.BugListGenericEqoutput. Low priority, language-server noise only.Approach
Either keep a placeholder
_parameter so the definition arity matches the call convention, or narrow the call site to the real arity.Prerequisites / Relations
Relates to #275 (shared unused-parameter / dead-argument handling; non-blocking).
Verification / Measurement
lua-language-server reports no
redundant-parameteron the affected golden outputs (Golden.GenericEqTwoTypes,Golden.BugListGenericEq).Open questions
Which fix direction to take: a placeholder
_parameter on the definition, or narrowing the call site to the real arity.