Files
kotlin-fork/compiler/testData/codegen/box/inline/redundantCoercionsCleanerKT48876.kt
T
2024-02-26 13:38:49 +00:00

22 lines
346 B
Kotlin
Vendored

// WITH_STDLIB
import kotlin.test.*
// The test below is inspired by https://youtrack.jetbrains.com/issue/KT-48876.
fun bar2(): Any {
return foo2()
}
inline fun foo2(): Int {
return try {
throw Throwable()
} catch (e: Throwable) {
return 2
}
}
fun box(): String {
assertEquals(2, bar2())
return "OK"
}