interface I1 { } interface I2 { } operator fun I1.component1(): Int { return 1 } operator fun I2.component2(): String { return "" } fun test(x: I1) { when { x !is I2 -> return Unit } val : I1 = x /*as I2 */ val c1: Int = /*as I2 */.component1() val c2: String = /*as I2 */.component2() }