-
-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The emmylua annotation ---@vararg
causes incorrect key-val type inference when using pairs() on a table
Reproduce
--- @diagnostic disable: unused-local, empty-block
--- @class MyType
--- @type table<number, MyType>
local tb = {}
--- @vararg string
function test(...)
for key, val in pairs(tb) do -- key, val has wrong type (string)
end
end
function test_no_varargs(...)
for key, val in pairs(tb) do -- key, val has correct type
end
end
Client
Windows VSCode
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working