Native: add test for ^KT-48876

The issue itself was already fixed in 981a6ffe.
This commit is contained in:
Svyatoslav Scherbina
2021-10-21 21:16:17 +03:00
committed by Space
parent eec4ac644c
commit 65bea27431
@@ -15,3 +15,21 @@ inline fun foo(): Int = runAndThrow {
val result: Any = foo()
assertEquals(1, result)
}
// 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
}
}
@Test fun runTest2() {
assertEquals(2, bar2())
}