We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have some issue here:
---@class Foo ---@field f number ---@type fun(self: Foo, ...): Foo local Foo = setmetatable({}, { __call = function(self) return self end }) function Foo.new() end function Foo:doSomething() return self.f -- Undefined field `f`. end
Originally posted by @kevinhwang91 in #1050 (comment)
The text was updated successfully, but these errors were encountered:
In version 3.0, I strictly set that only the last ---@class / ---@type will affect the code.
---@class
---@type
You need to change the line 3 to ---@type Foo | fun(self: Foo, ...): Foo
---@type Foo | fun(self: Foo, ...): Foo
Sorry, something went wrong.
---@class Foo ---@field f number ---@type Foo|fun(self: Foo): Foo local Foo = setmetatable({}, { __call = function(self) return self end }) Foo.__index = Foo ---@return Foo function Foo.new() local o = {} setmetatable(o, Foo) return o end function Foo:doSomething() return self.f end function Foo.build() local o = Foo.new() o:doSomething() -- Undefined field `doSomething`. end
Complain Undefined field doSomething at o:doSomething() . I must delete the empty line at line 3.
Undefined field doSomething
o:doSomething()
How can I make the Foo be regarded as Class in semantictoken? For now, it become as Function.
Foo
Class
Function
I can support ---@overload under ---@class
---@overload
Done.
No branches or pull requests
I have some issue here:
Originally posted by @kevinhwang91 in #1050 (comment)
The text was updated successfully, but these errors were encountered: