groostav
10/25/2017, 6:49 PM1 + 2 * 3 == 1 + 6 == 7
I would think that
operator fun MyObj.plus(o: MyObj): MyObj = this.apply { println("$this plus $o") }
operator fun MyObj.times(o: MyObj): MyObj = this.apply { println("$this times $o") }
val a = MyObj("A")
val b = MyObj("B")
val c = MyObj("C")
val x = a + b * c
would output
B times C
A plus B