Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1892 from retronym/ticket/6479
SI-6479 Don't lift try exprs in label arguments.
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,56 @@ | |||
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() | |||
} | |||
} | |||
} | |||
|
|||
} |