Open
Description
Infers a
and aa
correctly but not the rest
---@diagnostic disable: codestyle-check, spell-check, unused-local
---@alias AnyChild A|B|C
---@class PARENT
local PARENT = {}
---@class A: PARENT
local A = {}
---@class B: PARENT
local B = {}
---@class C: PARENT
local C = {}
---@overload fun(self:PARENT): A
---@overload fun(self:AnyChild, other: A): A
---@overload fun(self:AnyChild, other: B): B
function PARENT:new(other)
self.a = 2
return {}
end
local a = A:new()
local aa = a:new()
local aaa = a:new(B)
local b = B:new(B)
local bb = b:new(B)
local bbb = b:new(C)