Skip to content

---@return self #2002

Open
Open
@RomanSpector

Description

@RomanSpector

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?

Type Checking

Expected Behaviour

image

Actual Behaviour

image

Reproduction steps

---@class Test1
local Test1 = {};

---@return self
function Test1:New()
    return setmetatable({}, { __indeex = self });
end

---@class Test2 : Test1
local Test2 = {};


local test1 = Test1:New();
local test2 = Test2:New();

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeat/genericRelated to generic emulation feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions