Skip to content

Adding an overload to an @class changes the result and gives type errors. #2978

Open
@MatthewBlanchard

Description

@MatthewBlanchard

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?

Type Checking

Expected Behaviour

Adding an Overload under ---@Class should not change anything about how the type is handled.

Actual Behaviour

image

Here we have a class declaration and it's exactly how I want.

image

Adding an overload for the constructor generates warnings? Doesn't really make any sense.

Reproduction steps

Use ---@Class to define a class.
Add ---@overload.
Make sure the class library you're using returns anything but any when extending or creating a new class.

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions