Call chain into sequence: add 'flatten' to conversion targets #KT-26969 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
bd27460694
commit
3f252b15e1
+1
@@ -219,6 +219,7 @@ private val transformations = listOf(
|
||||
"filterIsInstance",
|
||||
"filterNot",
|
||||
"filterNotNull",
|
||||
"flatten",
|
||||
"map",
|
||||
"mapIndexed",
|
||||
"mapIndexedNotNull",
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1), listOf(2)).<caret>flatten().filter { it > 1 }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1), listOf(2)).asSequence().flatten().filter { it > 1 }.toList()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1), listOf(2, 3)).<caret>filter { it.size > 1 }.flatten()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1), listOf(2, 3)).asSequence().filter { it.size > 1 }.flatten().toList()
|
||||
}
|
||||
+10
@@ -569,6 +569,16 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
||||
runTest("idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/endsWithGroupingBy.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("flatten.kt")
|
||||
public void testFlatten() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/flatten.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("flatten2.kt")
|
||||
public void testFlatten2() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/flatten2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("implicitReceiver.kt")
|
||||
public void testImplicitReceiver() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/implicitReceiver.kt");
|
||||
|
||||
Reference in New Issue
Block a user