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
Warning is only generated for the first vararg parameter #3340
Warning is generated for each argument with mismatched type for ---@vararg type and '---@PARAM ... type' annotations.
Actual Behaviour
Warning generated only for the first passed argument.
Reproduction steps
Paste following lua code into VSCode
---@param ... number
function Test(...) end
Test(1) -- OK, no warning
Test("1") -- OK, warning in place
Test(1, 2, 3) -- OK, no warnings
Test("1", "2", "3") -- There is only warning for "1" but no warning for "2" and "3". I.e. warning is only generated for the first argument
Test(1, "2", "3") -- still no warnings for "2" and "3".
Additional Notes
I am observing the same behavior for legacy ---@varargs
Activity
[-]@vararg type check does not generate warning[/-][+]Warning is only generated for the first vararg parameter[/+]