Skip to content

Class generics cannot inherit directly from the generic #2645

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
SReject opened this issue Apr 29, 2024 · 2 comments
Open

Class generics cannot inherit directly from the generic #2645

SReject opened this issue Apr 29, 2024 · 2 comments

Comments

@SReject
Copy link

SReject commented Apr 29, 2024

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

@CppCXY
Copy link
Collaborator

CppCXY commented Apr 30, 2024

luals doesn't support generic classes yet.

@SirWrexes
Copy link

luals doesn't support generic classes yet.

☝️🤓 Actually , it does since #3055, merged in 3.13.6.
The support is still a bit limited, however.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants