JS: decomposition of vars
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user