Files
kotlin-fork/compiler/testData/codegen/componentEvaluatesOnlyOnce.kt
T
Alexander Udalov 5313cf3bf0 Fix failing tests, copy testData
Some tests were using files that others called blackBoxFile() on. Since
those files are now moved to box/, copy them back to make the tests pass
2013-01-28 18:20:25 +04:00

17 lines
374 B
Kotlin

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