lua-language-server
lua-language-server copied to clipboard
---@return self
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?
Type Checking
Expected Behaviour

Actual Behaviour

Reproduction steps
---@class Test1
local Test1 = {};
---@return self
function Test1:New()
return setmetatable({}, { __indeex = self });
end
---@class Test2 : Test1
local Test2 = {};
local test1 = Test1:New();
local test2 = Test2:New();
Additional Notes
No response
Log File
No response
Isn't this a duplicate of https://github.com/LuaLS/lua-language-server/issues/1505 ?
Is this issue fixed?
Is this issue fixed?
I don't think so. You may want to try the workaround mentioned here: https://github.com/LuaLS/lua-language-server/discussions/3057#discussioncomment-11983912
Or use CppCXY's new rust-based language server: https://github.com/LuaLS/lua-language-server/issues/3017 His server has better generic support, including the correct behavior mentioned in this issue.