lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Class generics cannot inherit directly from the generic

Open SReject opened this issue 1 year ago • 2 comments

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

Expected Behaviour

When defining a generic class, the class should be able to inherit directly from the generic, allowing an extension of the generic

---@class Example<T>: T
---@field thing boolean

Actual Behaviour

Lua diagnostics reports "undefined class `T`"

Reproduction steps

Copy the following into VSCode

---@class Example<T>: T

Hover over the second T

Additional Notes

No response

Log File

No response

SReject avatar Apr 29 '24 18:04 SReject

luals doesn't support generic classes yet.

CppCXY avatar Apr 30 '24 02:04 CppCXY