MoveVariableDeclarationIntoWhenInspection: report it if initializer is single line even if property is multi line

#KT-39467 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-07-17 11:48:14 +09:00
committed by Dmitry Gridin
parent 75d4c7e91c
commit 4569b85a16
6 changed files with 54 additions and 5 deletions
@@ -0,0 +1,10 @@
fun test() = 42
fun foo() {
val <caret>a =
test()
when (a) {
1 -> 0
else -> 24
}
}
@@ -0,0 +1,8 @@
fun test() = 42
fun foo() {
when (test()) {
1 -> 0
else -> 24
}
}
@@ -0,0 +1,10 @@
fun test() = 42
fun foo() {
val <caret>a =
test()
when (a) {
1 -> a
else -> 24
}
}
@@ -0,0 +1,9 @@
fun test() = 42
fun foo() {
when (val a =
test()) {
1 -> a
else -> 24
}
}