How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Annotations, Type Checking, Diagnostics/Syntax Checking
Expected Behaviour

Actual Behaviour

Reproduction steps
---@generic T
---@param arr T[]
---@param val? T|(fun(e : T) : boolean)
---@return T? element
local function find(arr, val)
return arr[1]
end
local arr = { 'a', 'b' }
find(arr, 'b')
Additional Notes
Not sure if my annotations are wrong, but it worked in the previous version. If I change the signature so that the second parameter is T instead of T|fun(e : T) : boolean then it works fine.
---@generic T
---@param arr T[]
---@param val? T
---@return T? element
local function find(arr, val)
Thanks for your continued work on the language server!
Log File
Let me know if you need it.
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Annotations, Type Checking, Diagnostics/Syntax Checking
Expected Behaviour
Actual Behaviour
Reproduction steps
Additional Notes
Not sure if my annotations are wrong, but it worked in the previous version. If I change the signature so that the second parameter is
Tinstead ofT|fun(e : T) : booleanthen it works fine.Thanks for your continued work on the language server!
Log File
Let me know if you need it.