Introduce "Lift return out of try" intention #KT-18830 Fixed

This commit is contained in:
Toshiaki Kameyama
2017-07-08 18:24:31 +03:00
committed by Mikhail Glukhikh
parent 8f9b680fc6
commit 8cc9330e63
38 changed files with 601 additions and 7 deletions
@@ -0,0 +1,17 @@
// PROBLEM: none
fun doSomething() {}
fun test(n: Int) {
var res: String? = null
<caret>try {
res = "success"
} catch (e: Exception) {
throw e
} finally {
if (n == 1)
doSomething()
else
res = "finally"
}
}