-
Beta Was this translation helpful? Give feedback.
Answered by
tomlau10
Jan 28, 2025
Replies: 1 comment 1 reply
-
This has been reported in a few duplicated issues:
in short The generic inheritance has not been implemented for the time being: #1505 (comment) The workaround---@generic T
---@param self T
---@param name string
---@return T
function Person:new(name)
self.__index = self
return setmetatable({ name = name }, self)
end
Or try CppCXY's language serverOr you might try CppCXY's lua language server written in rust, it doesn't has this bug, and it has better generic support also. I just tried his server, you have to write the method as ---@param name string
---@return self
function Person:new(name)
self.__index = self
return setmetatable({ name = name }, self)
end => it can then correctly identify |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shibotto
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This has been reported in a few duplicated issues:
in short The generic inheritance has not been implemented for the time being: #1505 (comment)
The workaround
@generic
to match the paramself
, and finally return this generic type=> then this function can return the type based on caller
Or try CppCXY's language server
Or you might try CppCXY's lua language server written in rust, it doesn't has this bug, and it has better generic support also.
See: #3017
I just tried his server, you have to wr…