diff --git a/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt b/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt index ce32924eb6e..424a364c5bd 100644 --- a/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt +++ b/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt @@ -1,10 +1,21 @@ // WITH_RUNTIME -import java.io.* - -fun test(r: Reader) { - val ss = hashSetOf() - r.useLines { it.forEach { ss.add(it) } } +fun test(list: List) { + val result = mutableListOf() + use1 { list.forEach { result.add(it) } } } -// 2 POP +inline fun use1(f: () -> T): T { + return use2(f) +} + +inline fun use2(f: () -> T): T { + try { + return f() + } + catch (e: Exception) { + throw e + } +} + +// 1 POP