Files
kotlin/compiler/testData/codegen/box/multiDecl/component.kt
2019-11-19 11:00:09 +03:00

22 lines
463 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
class S(val a: String, val b: String) {
operator fun component1() : String = a
operator fun component2() : String = b
}
operator fun S.component3() = ((a + b) as String).substring(2)
class Tester() {
fun box() : String {
val (o,k,ok,ok2) = S("O","K")
return o + k + ok + ok2
}
operator fun S.component4() = ((a + b) as String).substring(2)
}
fun box() = Tester().box()