Skip to content

@overload Constructor problem with the Return  #1345

Description

@Sedas25

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions