KT-14209 for loop to stdlib: sum is not recognized if before was check for type
#KT-14209 Fixed
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: "Replace with 'filterIsInstance<>().sum()'"
|
||||
// INTENTION_TEXT_2: "Replace with 'asSequence().filterIsInstance<>().sum()'"
|
||||
fun foo(list: List<Any>){
|
||||
var result = 0
|
||||
<caret>for (l in list)
|
||||
if (l is Int)
|
||||
result += l
|
||||
}
|
||||
Reference in New Issue
Block a user