Skip to content

Allow to set named fields for generic class #1935

Closed
@sadSader

Description

@sadSader

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Annotations, Type Checking

Expected Behaviour

Field declaration should have priority over generic types
---@Class gener: { [string]: number}
---@field field string

Expecting gener.field to have type string.

Actual Behaviour

Field get type from generic declaration and field declaration

Reproduction steps

image

Additional Notes

I understand that generics are not fully supported yet and there are a lot of issues. Feel free to close this issue if it is a duplicate.

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions