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

@overload Constructor problem with the Return #1345

Closed
Sedas25 opened this issue Jul 18, 2022 · 0 comments
Closed

@overload Constructor problem with the Return #1345

Sedas25 opened this issue Jul 18, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@Sedas25
Copy link

Sedas25 commented Jul 18, 2022

if you use @overload fun() for functions that return self there are problems with the diagnostic (return-type-mismatch)

---@class TestBoard
---@field Data table
---@overload fun(cObject:CMLuaObject):TestBoard
local TestBoard = {}

---@param aKey any
---@param aValue any
---@return TestBoard self
function TestBoard:Add(aKey,aValue)
  self.Data[aKey] = aValue
  return self
end

image

@sumneko sumneko added the bug Something isn't working label Jul 18, 2022
@sumneko sumneko modified the milestone: 3.5.0 Jul 18, 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