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?>){
val <caret>result = list
.asSequence()
.filterNotNull()
.sum()
}