Files
kotlin-fork/backend.native/tests/codegen/try/catch6.kt
T
2017-10-20 18:25:05 +03:00

25 lines
432 B
Kotlin

package codegen.`try`.catch6
import kotlin.test.*
@Test fun runTest() {
try {
println("Before")
foo()
println("After")
} catch (e: Exception) {
println("Caught Exception")
} catch (e: Error) {
println("Caught Error")
}
println("Done")
}
fun foo() {
try {
throw Error("Error happens")
} catch (e: Exception) {
println("Caught Exception")
}
}