lua-language-server
lua-language-server copied to clipboard
Way to annotate `@overload` only table, instead of the entire `@class`
---@class Class
---@overload fun(): self|Class
local Class = {}
local c = Class()
local unknown = c() -- but unknown is Class
I thought that was the indication self/Class was responsible for this
self for object
Class for table
But today I discovered that this is not so. And in previous versions as well
In principle, this can be achieved by explicitly making
---@cast Class Class|fun(): Class
But for long names it is extremely monstrous