Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

---@return self #2002

Open
RomanSpector opened this issue Mar 12, 2023 · 3 comments
Open

---@return self #2002

RomanSpector opened this issue Mar 12, 2023 · 3 comments
Labels
bug Something isn't working feat/generic Related to generic emulation feature

Comments

@RomanSpector
Copy link

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

@sumneko sumneko added the bug Something isn't working label Mar 13, 2023
@C3pa
Copy link
Contributor

C3pa commented Mar 18, 2023

Isn't this a duplicate of #1505 ?

@sumneko sumneko added the feat/generic Related to generic emulation feature label Jun 14, 2023
@zhangchongyu
Copy link

Is this issue fixed?

@tomlau10
Copy link
Contributor

Is this issue fixed?

I don't think so.
You may want to try the workaround mentioned here: #3057 (comment)

Or use CppCXY's new rust-based language server: #3017
His server has better generic support, including the correct behavior mentioned in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feat/generic Related to generic emulation feature
Projects
None yet
Development

No branches or pull requests

5 participants