lua-language-server
lua-language-server copied to clipboard
setfenv
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( ---@param f async fun(...):...|integer
---@param table table
---@return function
function setfenv(f, table) end` ---@param f integer|async fun(...):...
---@param table table
---@return function
function setfenv(f, table) end` No response)
Additional Notes
maybe change definition from
`---
---Sets the environment to be used by the given function.
---View documents
to
`---
---Sets the environment to be used by the given function.
---View documents
Log File