-
-
Notifications
You must be signed in to change notification settings - Fork 387
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Type Checking
Expected Behaviour
This is similar to #1355
When I try and itterate over a Vararg table, it'll be unable to determine the indexing value.
Actual Behaviour
My enabling of no-unknowns comes and bites me as the key is unknown.
Reproduction steps
---@param ... AnyType
function any(...)
for key, value in pairs{...} do
-- key is typed as an unknown instead of integer
-- value is typed as AnyType
end
endAdditional Notes
I've been told that there might be edge cases that are why this isn't how it currently works, but I thought I'd ask to at least find them out and learn more.
And if you are questioning why I'm using pairs instead of ipairs, that's because I'm modding in factorio with a deterministic pairs. It is actually faster than ipairs with functionally the same result, but with support for sparse arrays (this makes other Lua environments so sad to work with...).
Finally, I'm writing this at work in the morning before I forget, so I'm not being as thorough as I would prefer. I can absolutely get more information if requested.
Log File
No response