Skip to content

vararg overload issue #2277

Open
Open
@GiuseppeIII

Description

@GiuseppeIII

If you have a function which takes in only a vararg and you only overload it, the input type is as expected just each of the overloads:

---@overload fun(param1: "test", param2: string)
---@overload fun(param1: "test2", param2: number)
---@overload fun(param1: "test3", param2: boolean, param3: number)
local function test(...)
end

test()
Screenshot_2

However, if you have a param before the vararg, the input type always becomes param, ...any:

---@overload fun(param1: "test", param2: string)
---@overload fun(param1: "test2", param2: number)
---@overload fun(param1: "test3", param2: boolean, param3: number)
local function test(param1, ...)
end

test()
Screenshot_3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions