Files
kotlin/compiler/testData/codegen/boxInline/tryCatchFinally/tryCatch2.2.kt
2014-07-07 10:51:46 +04:00

19 lines
495 B
Kotlin

class My(val value: Int)
inline fun <T, R> T.performWithFail(job: (T)-> R, failJob : (T) -> R) : R {
try {
return job(this)
} catch (e: RuntimeException) {
return failJob(this)
}
}
inline fun <T, R> T.performWithFail2(job: (T)-> R, failJob : (e: RuntimeException, T) -> R) : R {
try {
return job(this)
} catch (e: RuntimeException) {
return failJob(e, this)
}
}
public inline fun String.toInt2() : Int = java.lang.Integer.parseInt(this)