Move variable declaration into when: don't report when property has 'break' or 'continue'
#KT-31999
This commit is contained in:
committed by
Mikhail Glukhikh
parent
877e583a96
commit
998adfb098
+12
@@ -0,0 +1,12 @@
|
||||
// PROBLEM: none
|
||||
fun test() {
|
||||
for (i in 1..10) {
|
||||
val <caret>some = foo(i) ?: continue
|
||||
when (some) {
|
||||
"some" -> some
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(i: Int): String? = ""
|
||||
Reference in New Issue
Block a user