Files
kotlin-fork/idea/jvm-debugger/jvm-debugger-test/testData/stepping/custom/finallyBlock.kt
T
2019-10-08 19:13:55 +09:00

49 lines
742 B
Kotlin
Vendored

package finallyBlock
fun throwException() { throw RuntimeException() }
fun foo() {}
fun main(args: Array<String>) {
fun wrap(f: () -> Unit) = try { f() } catch (e: Throwable) {}
wrap(::test1)
wrap(::test2)
wrap(::test3)
}
fun test1() {
try {
//Breakpoint!
throwException()
} finally {
//Breakpoint!
foo()
}
}
fun test2() {
try {
//Breakpoint!
foo()
} finally {
//Breakpoint!
foo()
}
}
fun test3() {
try {
//Breakpoint!
throwException()
} finally {
//Breakpoint!
try {
throwException()
} finally {
//Breakpoint!
foo()
}
}
}
// RESUME: 7