Introduce "Lift return out of try" intention #KT-18830 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
8f9b680fc6
commit
8cc9330e63
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
fun doSomething() {}
|
||||
|
||||
fun test(n: Int) {
|
||||
var res: String? = null
|
||||
var foo: String? = null
|
||||
|
||||
<caret>try {
|
||||
res = "success"
|
||||
} catch (e: Exception) {
|
||||
throw e
|
||||
} finally {
|
||||
if (n == 1)
|
||||
doSomething()
|
||||
else
|
||||
foo = "finally"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user