KT-14294 for to stdlib to firstOrNull/lastOrNull: intention is absent if there is additional var before for loop
#KT-14294 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// WITH_RUNTIME
|
||||
// IS_APPLICABLE: false
|
||||
// IS_APPLICABLE_2: false
|
||||
fun foo(list: List<Any>) {
|
||||
var v: String?
|
||||
|
||||
v = null
|
||||
<caret>for (o in list) {
|
||||
if (bar(o as String)) {
|
||||
v = o
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun bar(s: String): Boolean = true
|
||||
Reference in New Issue
Block a user