Skip to content

Class generics cannot inherit directly from the generic #2645

@SReject

Description

@SReject

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions