Ayfri
03/16/2022, 5:59 PMtypealias AABB = Rectangle
with an external "constructor" fun Rectangle(x: Int = 0, y: Int = 0, width: Int = 0, height = 0) = ...
but it's not present on the type AABB, I also tested with fun Rectangle.invoke(x: Int ...
but it still doesn't work, is it possible ?Casey Brooks
03/16/2022, 6:01 PMfun Rectangle.Companion.invoke(...): Rectangle
Ruckus
03/16/2022, 6:03 PMfun Rectangle(...)
(or fun AABB(...)
)Ayfri
03/16/2022, 6:04 PMinvoke
has to be on the Companion object, it kinda works, as I can't directly do val a = AABB()
but val a = AABB.invoke()
operator
, it works thanks x)turansky
03/30/2022, 10:13 PMfun
with similar name, suggested by @Ruckus is more flexible solution in this case