Files
kotlin-fork/compiler/testData/ir/irText/expressions/smartCastsWithDestructuring.kt.txt
T
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00

27 lines
369 B
Kotlin
Vendored

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
}
// COMPOSITE {
val tmp0_container: I2 = x /*as I2 */
val c1: Int = tmp0_container /*as I1 */.component1()
val c2: String = tmp0_container.component2()
// }
}