Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different function arguments based off a parametre #2084

Closed
Frityet opened this issue Apr 22, 2023 · 1 comment
Closed

Different function arguments based off a parametre #2084

Frityet opened this issue Apr 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Frityet
Copy link
Contributor

Frityet commented Apr 22, 2023

It would be really useful to have something like

---@overload fun(x: "one", y: integer)
---@param x "two"
---@param y string
---@param z string
local function func(x, y, z) end

so that

func("one", 43)
func("one", "32") --error
func("two", "32", "blah") -- ok
@carsakiller
Copy link
Collaborator

Function overloading and narrowing of the correct overload is already being discussed over in #1456

@sumneko sumneko added the enhancement New feature or request label Apr 24, 2023
@Frityet Frityet closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants