MoveVariableDeclarationIntoWhenInspection should move caret to subject expression
#KT-31954 Fixed
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun test() = true
|
||||
|
||||
fun foo(): Int {
|
||||
return when (test()) {
|
||||
return when (<caret>test()) {
|
||||
true -> 42
|
||||
else -> null
|
||||
} ?: 55
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun test() = 42
|
||||
|
||||
fun foo() {
|
||||
val b = when (val a = test()) {
|
||||
val b = when (val <caret>a = test()) {
|
||||
1 -> a
|
||||
else -> 24
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun test() = true
|
||||
|
||||
fun foo() {
|
||||
val b = !when (test()) {
|
||||
val b = !when (<caret>test()) {
|
||||
true -> true
|
||||
else -> false
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun test() = 42
|
||||
|
||||
fun foo() {
|
||||
when (val a = test()) {
|
||||
when (val <caret>a = test()) {
|
||||
1 -> a
|
||||
else -> 24
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun foo() {
|
||||
|
||||
// comment
|
||||
when (1) {
|
||||
when (<caret>1) {
|
||||
1 -> {
|
||||
}
|
||||
else -> {
|
||||
|
||||
Reference in New Issue
Block a user