-
-
Notifications
You must be signed in to change notification settings - Fork 398
Open
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Type Checking
Expected Behaviour
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
Log File
No response
Metadata
Metadata
Assignees
Labels
No labels