[K/N] Better handling of nested returns in RedundantCoercionsCleaner.kt

^KT-49356
This commit is contained in:
Pavel Kunyavskiy
2021-11-11 12:30:10 +03:00
committed by Space
parent 41547174a7
commit 523cb4b3e8
2 changed files with 27 additions and 1 deletions
@@ -33,3 +33,17 @@ inline fun foo2(): Int {
@Test fun runTest2() {
assertEquals(2, bar2())
}
// Test for https://youtrack.jetbrains.com/issue/KT-49356.
inline fun foo3(): Int {
return (return 3)
}
fun bar3(): Any {
return foo3()
}
@Test fun runTest3() {
assertEquals(3, bar3())
}