lua-language-server
                                
                                 lua-language-server copied to clipboard
                                
                                    lua-language-server copied to clipboard
                            
                            
                            
                        Function with generic variable return type loses typing after first return
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?
Type Checking
Expected Behaviour
ret2 in the example should be listed as string
Actual Behaviour
ret2 is listed as unknown
Reproduction steps
---@generic T
---@param arg T
---@return T ...
function GenericReturn(arg) end
local ret1, ret2 = GenericReturn("")
Additional Notes
Changing the return type to T|string correctly types the variable return but does not inherit the generic's typing.
Log File
No response