Exceptions/Catch an exception thrown in a nested call: Difference between revisions

(Added Kotlin)
Line 1,628:
<lang scala>// version 1.0.6
 
class U0 : Throwable("U0 occurred") {}
class U1 : Throwable("U1 occurred") {}
 
fun foo() {
for (i in 1..2) {
try {
bar(i)
} catch(e: U0) {
catch(e: U0) {
println(e.message)
}
}
}