-
-
Notifications
You must be signed in to change notification settings - Fork 372
Closed
Labels
duplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)
Description
Describe the bug
Generics do not work when declaring classes,
I get Undefined type or alias T
, and the field data
does not autocomplete.
I am not sure if this is intentional or not because the <T>
does highlight in the ---@class
properly. I didn't see anyone using generic class fields though although I thought that'd be a very common usecase.
To Reproduce
---@class Test<T>
---@field data T
---@return Test<number>
function Test.new()
return {}
end
local x = Test.new()
Expected behavior
I expected the field data
to be defined as a number
Environment (please complete the following information):
- OS: Windows
- Is WSL remote? No
- Client: VSCode
Metadata
Metadata
Assignees
Labels
duplicateThis issue or pull request already existsThis issue or pull request already existsenhancementNew feature or requestNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)