fix for multiple evaluation of expression on multi var declaration

This commit is contained in:
Alex Tkachman
2012-08-31 11:45:56 +03:00
parent dd3323cae2
commit bf892870e1
4 changed files with 79 additions and 6 deletions
@@ -0,0 +1,17 @@
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()