Skip to content

[Feature Request] Automatically overload with __call metamethod. #2920

@mikuhl-dev

Description

@mikuhl-dev

There is already custom behavior when __index is defined in a metatable, why not __call? You can manually define the overload, but then you have to define the signature twice.

---@overload fun(a: string, b: number): boolean
local foo = setmetatable({}, {
    ---@param a string
    ---@param b number
    ---@return boolean
    __call = function(a, b)
        return true;
    end
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions