Call chain into sequence: add 'unzip' to conversion targets #KT-27486 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
3f252b15e1
commit
dc750cdbb3
+2
-1
@@ -304,7 +304,8 @@ private val terminations = listOf(
|
||||
"toMutableList",
|
||||
"toMutableSet",
|
||||
"toSet",
|
||||
"toSortedSet"
|
||||
"toSortedSet",
|
||||
"unzip"
|
||||
).associate {
|
||||
val pkg = if (it in listOf("contains", "indexOf", "lastIndexOf")) "kotlin.collections.List" else "kotlin.collections"
|
||||
it to FqName("$pkg.$it")
|
||||
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
val pair: Pair<List<Int>, List<Int>> = listOf(1 to 2, 3 to 4).<caret>filter { it.first > 1 }.filter { it.second > 2 }.unzip()
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test() {
|
||||
val pair: Pair<List<Int>, List<Int>> = listOf(1 to 2, 3 to 4).asSequence().filter { it.first > 1 }.filter { it.second > 2 }.unzip()
|
||||
}
|
||||
+5
@@ -1010,6 +1010,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
||||
public void testToSortedSet() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/toSortedSet.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unzip.kt")
|
||||
public void testUnzip() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/collections/convertCallChainIntoSequence/termination/unzip.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user