blob: c463bc5ab0e6ebb07b1404882e694fb82f19fb3d (
plain) (
tree)
|
|
object TailrecAfterTryCatch {
@annotation.tailrec
final def good1() {
1 match {
case 2 => {
try {
// return
} catch {
case e: ClassNotFoundException =>
}
good1()
}
}
}
@annotation.tailrec
final def good2() {
//1 match {
// case 2 => {
try {
return
} catch {
case e: ClassNotFoundException =>
}
good2()
// }
//}
}
@annotation.tailrec
final def good3() {
val 1 = 2
try {
return
} catch {
case e: ClassNotFoundException =>
}
good3()
}
@annotation.tailrec
final def bad() {
1 match {
case 2 => {
try {
return
} catch {
case e: ClassNotFoundException =>
}
bad()
}
}
}
}
|