mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
28 lines
434 B
Kotlin
28 lines
434 B
Kotlin
inline fun test(s: ()->Int){
|
|
var i = 0;
|
|
i = s()
|
|
try {
|
|
i = i + 10
|
|
} finally {
|
|
i
|
|
}
|
|
}
|
|
|
|
fun box() : String {
|
|
var p: Int = 1
|
|
test {
|
|
try {
|
|
p = 1
|
|
return "OK" //finally from inline fun doen't split this try
|
|
} catch(e: Exception) {
|
|
p = -1;
|
|
p
|
|
} finally {
|
|
p++
|
|
}
|
|
|
|
}
|
|
return "fail"
|
|
}
|
|
|
|
// 10 TRYCATCHBLOCK |