KT-14209 for loop to stdlib: sum is not recognized if before was check for type

#KT-14209 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-10-14 16:35:12 +03:00
parent f5d4b1dc8d
commit afd25548a2
9 changed files with 84 additions and 1 deletions
@@ -0,0 +1,9 @@
// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'filterNotNull().sum()'"
// INTENTION_TEXT_2: "Replace with 'asSequence().filterNotNull().sum()'"
fun foo(list: List<Int?>){
var result = 0
<caret>for (l in list)
if (l != null)
result += l
}