Implement Unwrap/Remove for try expressions

This commit is contained in:
Alexey Sedunov
2013-06-19 16:08:53 +04:00
parent 9d46c90165
commit 0b634cc918
27 changed files with 494 additions and 6 deletions
@@ -0,0 +1,11 @@
// OPTION: 1
fun foo(n : Int): Int {
<caret>try {
val m = n + 1
m/0
} catch (e: Exception) {
-1
}
return 0
}
@@ -0,0 +1,7 @@
// OPTION: 1
fun foo(n : Int): Int {
val m = n + 1
m/0
return 0
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: false
fun foo(n : Int): Int {
return <caret>try {
val m = n + 1
m/0
} catch (e: Exception) {
-1
}
}
@@ -0,0 +1,8 @@
// OPTION: 0
fun foo(n : Int): Int {
return try {
n/0<caret>
} catch (e: Exception) {
-1
}
}
@@ -0,0 +1,4 @@
// OPTION: 0
fun foo(n : Int): Int {
return n/0
}