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

[Bug]方法内的字段不再被扫描进class #1039

Closed
HiKit opened this issue Apr 12, 2022 · 4 comments
Closed

[Bug]方法内的字段不再被扫描进class #1039

HiKit opened this issue Apr 12, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@HiKit
Copy link

HiKit commented Apr 12, 2022

版本 V 3.0.1

---@class TestA
_G.TestA = {};

function TestA:Test()
	self.a = 1;
end

如下图,字段a没有被识别为TestA的字段,旧版本是能正常识别的
image

@HiKit
Copy link
Author

HiKit commented Apr 12, 2022

继承关系也不再生效

---@class TestA
_G.TestA = {};

function TestA:New()
	return setmetatable({}, { __index = TestA });
end

function TestA:Test()
	self.a = 1;
end

---@class TestB : TestA
_G.TestB = {};

local a = TestA:New();
a:Test();

local b = TestB:New();
b:Test();

如下图所示,TestB及TestB的实例都检查错误
image
image

image

@HiKit
Copy link
Author

HiKit commented Apr 12, 2022

回退版本测试了下,3.0.0版本出现的问题

@HiKit
Copy link
Author

HiKit commented Apr 12, 2022

看到这个更新了 #980

@sumneko sumneko added the bug Something isn't working label Apr 12, 2022
@sumneko
Copy link
Collaborator

sumneko commented Apr 14, 2022

第一个问题等之后 #980 更新。
第二个问题已修复。

@sumneko sumneko closed this as completed Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants