blob: eb2af218025baec6e2a58c975b47d5039ea32408 [file]
// WITH_STDLIB
import kotlin.test.*
val sb = StringBuilder()
fun box(): String {
test()
assertEquals("""
Finally
Catch 2
Done
""".trimIndent(), sb.toString())
return "OK"
}
fun test() {
try {
try {
return
} catch (e: Error) {
sb.appendLine("Catch 1")
} finally {
sb.appendLine("Finally")
throw Error()
}
} catch (e: Error) {
sb.appendLine("Catch 2")
}
sb.appendLine("Done")
}