lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

[Feature Request] Automatically overload with `__call` metamethod.

Open mikuhl-dev opened this issue 11 months ago • 10 comments

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
});

mikuhl-dev avatar Oct 29 '24 20:10 mikuhl-dev