Skip to content

Conversation

taminomara
Copy link
Contributor

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:

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 #701

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
Copy link
Contributor Author

Ping?

@CppCXY
Copy link
Member

CppCXY commented Sep 11, 2025

code conflicts

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.

Improve semantics of variadic expansion
2 participants