operator fun Any.get(a: Int) { if (a > 0) { this[a - 1] } } class A { override fun equals(other: Any?): Boolean { this == other return true } operator fun inc(): A { this++ ++this return this } operator fun component1(): Int { // TODO: should be recursion marker too val (a) = this return 1 } operator fun unaryPlus() { +this } operator fun unaryMinus() { -this } operator fun plus(a: Int) { this + 1 this += 1 } operator fun invoke() { val a = A() a() a.invoke() this.invoke() this() } } class B operator fun B.invoke() { this() invoke() }