e2dbeae85e
also add some tests for bugs with unreachable code handling and variables
22 lines
392 B
Kotlin
22 lines
392 B
Kotlin
fun main(args : Array<String>) {
|
|
|
|
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")
|
|
}
|
|
} |