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