KT-20282 'Move statement up' works incorrectly for statement after 'finally' block if 'try' block contains closure
This commit is contained in:
committed by
Nikolay Krasko
parent
d3b1b7a5be
commit
9d6b36c249
@@ -0,0 +1,10 @@
|
||||
// MOVE: up
|
||||
fun test() {
|
||||
try {
|
||||
run {
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// MOVE: up
|
||||
fun test() {
|
||||
try {
|
||||
run {
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
run {
|
||||
}
|
||||
} else {
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
run {
|
||||
}
|
||||
} else {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
run {
|
||||
}
|
||||
} else if (i == 2) {
|
||||
} else if (i == 3) {
|
||||
} else {
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
run {
|
||||
}
|
||||
} else if (i == 2) {
|
||||
} else if (i == 3) {
|
||||
} else {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
run {
|
||||
}
|
||||
} else if (i == 2) {
|
||||
} else if (i == 3) {
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
if (i == 1) {
|
||||
run {
|
||||
}
|
||||
} else if (i == 2) {
|
||||
} else if (i == 3) {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// MOVE: up
|
||||
fun test() {
|
||||
try {
|
||||
run {
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
} finally {
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// MOVE: up
|
||||
fun test() {
|
||||
try {
|
||||
run {
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
} finally {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
when (i) {
|
||||
1 -> {
|
||||
run {
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
when (i) {
|
||||
1 -> {
|
||||
run {
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
}
|
||||
else -> {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
when (i) {
|
||||
1 -> {
|
||||
run {
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
}
|
||||
3 -> {
|
||||
}
|
||||
}
|
||||
<caret>println()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// MOVE: up
|
||||
fun test(i: Int) {
|
||||
when (i) {
|
||||
1 -> {
|
||||
run {
|
||||
}
|
||||
}
|
||||
2 -> {
|
||||
}
|
||||
3 -> {
|
||||
<caret>println()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user