Files
kotlin-fork/js/js.translator/testData/box/inline/incrementProperty.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

24 lines
413 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1115
package foo
// CHECK_NOT_CALLED: inc
// CHECK_NOT_CALLED: run
class Countable {
var count = 0
}
inline fun inc(countable: Countable) = countable.count++
inline fun run(func: () -> Unit) = func()
fun incNoInline(countable: Countable) = run { inc(countable) }
fun box(): String {
val c = Countable()
incNoInline(c)
assertEquals(1, c.count)
return "OK"
}