Files
kotlin/compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt
Alexander Udalov f5ff3d2fa9 Remove directives that have no effect from bytecode text tests
All bytecode text tests are run with stdlib in the classpath and only
for JVM backend, therefore directives WITH_RUNTIME, TARGET_BACKEND,
IGNORE_BACKEND are not needed
2018-12-20 12:53:24 +01:00

20 lines
312 B
Kotlin
Vendored

fun test(list: List<String>) {
val result = mutableListOf<String>()
use1 { list.forEach { result.add(it) } }
}
inline fun <T> use1(f: () -> T): T {
return use2(f)
}
inline fun <T> use2(f: () -> T): T {
try {
return f()
}
catch (e: Exception) {
throw e
}
}
// 1 POP