JS: decomposition of vars

This commit is contained in:
Alexey Tsvetkov
2015-04-14 17:59:01 +03:00
parent e80059e4a2
commit a9d38e8d22
4 changed files with 76 additions and 1 deletions
@@ -0,0 +1,19 @@
package foo
// CHECK_NOT_CALLED: component2
class A(val x: Int, val y: Int)
fun A.component1(): Int = fizz(x)
inline
fun A.component2(): Int = buzz(y)
fun box(): String {
val (a, b) = A(1, 2)
assertEquals(a, 1)
assertEquals(b, 2)
assertEquals("fizz(1);buzz(2);", pullLog())
return "OK"
}