summaryrefslogtreecommitdiff
path: root/plugins/kotlin/idea/tests/testData/intentions/convertToIndexedFunctionCall/basic/scanReduce.kt.after
blob: 1383f908cba6661fa28a2fd9f02b33fe4b0f0843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// INTENTION_TEXT: "Convert to 'runningReduceIndexed'"
// WITH_RUNTIME
// DISABLE-ERRORS
// AFTER-WARNING: This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn'
// TODO: fix warning?
// AFTER-WARNING: Parameter 'index' is never used, could be renamed to _
@OptIn(ExperimentalStdlibApi::class)
fun test(list: List<String>) {
    list.runningReduceIndexed { index, acc, s ->
        acc + s
    }
}