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

19 lines
335 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1112
fun test(x: Int): Any {
return try {
if (x % 2 == 0) throw RuntimeException()
x
}
catch (e: RuntimeException) {
}
}
fun box(): String {
val a = test(1)
if (a != 1) return "fail1: $a"
val b = test(2)
if (b != Unit) return "fail2: $b"
return "OK"
}