Native: RedundantCoercionsCleaner should rewrite nested returns too
This commit is contained in:
committed by
Space
parent
3176dd1341
commit
981a6ffeb8
@@ -0,0 +1,17 @@
|
||||
package codegen.inline.redundantCoercionsCleaner
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
inline fun runAndThrow(action: () -> Unit): Nothing {
|
||||
action()
|
||||
throw Exception()
|
||||
}
|
||||
|
||||
inline fun foo(): Int = runAndThrow {
|
||||
return 1
|
||||
}
|
||||
|
||||
@Test fun runTest() {
|
||||
val result: Any = foo()
|
||||
assertEquals(1, result)
|
||||
}
|
||||
Reference in New Issue
Block a user