Files
kotlin-fork/js/js.translator/testData/box/closure/closureInObject.kt
T
Alexey Andreev 3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00

29 lines
405 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1122
package foo
object A {
val a = 1
fun foo() = 31
val f = { a + foo() }
}
class B {
companion object {
val a = 21
fun foo() = 3
val f = { this.a + this.foo() }
}
}
fun box(): String {
val a = A.f()
if (a != 32) return "a != 32, a = $a"
val b = B.f()
if (b != 24) return "b != 24, b = $b"
return "OK"
}