Files
kotlin-fork/idea/testData/intentions/loopToCallChain/sum/sumByIntsIntoLong.kt
T
Valentin Kipyatkov d0f6e25783 sum and sumBy supported
2016-08-23 22:47:42 +03:00

11 lines
246 B
Kotlin
Vendored

// WITH_RUNTIME
// INTENTION_TEXT: "Replace with 'map{}.sum()'"
// INTENTION_TEXT_2: "Replace with 'asSequence().map{}.sum()'"
fun foo(list: List<Int>): Long {
var s = 0L
<caret>for (item in list) {
s += item
}
return s
}