Skip to content

Conversation

taminomara
Copy link
Contributor

The main part of implementation is done, I need to test more corner cases, and also make sure that we still properly handle multiple variadics in returns (things like fun(_: A..., _: B...): B..., A...).

Fix #714.

This PR checks for situation where variadic type expansion operator (`T...`)
is used in an unexpected place, and can't be handled properly. Users will get
a warning about such situations, and the operator will be ignored.

This prevents unexpected variadic types such as:

```lua
local x --- @type integer...
local x1, x2 = x
--             ^ EmmyLua thinks `x` is a result of a variadic expansion,
--    ^^  ^^     so it infers both `x1` and `x2` as integers.
```

Fix EmmyLuaLs#701
@taminomara taminomara marked this pull request as draft August 16, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow more complex variadic expansions
1 participant