ConvertCallChainIntoSequence: support functions added in Kotlin 1.4
#KT-40448 Fixed
This commit is contained in:
committed by
igoriakovlev
parent
5e91ffb156
commit
4901cdb11f
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxByOrNull { true }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxByOrNull { true }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxOf { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxOf { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxOfOrNull { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxOfOrNull { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxOfWith({ _, _ -> 0 }) { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxOfWith({ _, _ -> 0 }) { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxOfWithOrNull({ _, _ -> 0 }) { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxOfWithOrNull({ _, _ -> 0 }) { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxOrNull()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxOrNull()
|
||||
}
|
||||
idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/maxWithOrNull.kt
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.maxWithOrNull { _, _ -> 0 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.maxWithOrNull { _, _ -> 0 }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minByOrNull { true }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minByOrNull { true }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minOf { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minOf { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minOfOrNull { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minOfOrNull { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minOfWith({ _, _ -> 0 }) { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minOfWith({ _, _ -> 0 }) { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minOfWithOrNull({ _, _ -> 0 }) { it }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minOfWithOrNull({ _, _ -> 0 }) { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minOrNull()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minOrNull()
|
||||
}
|
||||
idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/minWithOrNull.kt
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.minWithOrNull { _, _ -> 0 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.minWithOrNull { _, _ -> 0 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.reduceIndexedOrNull { _, acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.reduceIndexedOrNull { _, acc, i -> acc + i }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.reduceOrNull { acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.reduceOrNull { acc, i -> acc + i }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.runningFold(0) { acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.runningFold(0) { acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.runningFoldIndexed(0) { _, acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.runningFoldIndexed(0) { _, acc, i -> acc + i }
|
||||
}
|
||||
idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/runningReduce.kt
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.runningReduce { acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.runningReduce { acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.runningReduceIndexed { _, acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.runningReduceIndexed { _, acc, i -> acc + i }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.scan(0) { acc, i -> acc + i }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.scan(0) { acc, i -> acc + i }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.scanIndexed(0) { _, acc, i -> acc + i }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.scanIndexed(0) { _, acc, i -> acc + i }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.<caret>filter { it > 1 }.sumOf { it }
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(list: List<Int>) {
|
||||
list.asSequence().filter { it > 1 }.sumOf { it }
|
||||
}
|
||||
Reference in New Issue
Block a user