lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

setfenv

Open Jayrgo opened this issue 1 year ago • 0 comments

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

no error

Actual Behaviour

Cannot assign `integer` to parameter `fun(...any):...integer|unknown`.
- `integer` cannot match `fun(...any):...integer|unknown`
- Type `integer` cannot match `fun(...any):...integer|unknown`
- Type `number` cannot match `fun(...any):...integer|unknown`Lua Diagnostics.(param-type-mismatch)

Reproduction steps

Lua version 5.1 setfenv(, )

Additional Notes

maybe change definition from `--- ---Sets the environment to be used by the given function.

---View documents

---@param f async fun(...):...|integer ---@param table table ---@return function function setfenv(f, table) end`

to `--- ---Sets the environment to be used by the given function.

---View documents

---@param f integer|async fun(...):... ---@param table table ---@return function function setfenv(f, table) end`

Log File

No response

Jayrgo avatar Jan 28 '24 13:01 Jayrgo