Introduce "flatMap { it } -> flatten" inspection #KT-25969 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
cdcc588a55
commit
2c71b3873e
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.collections.ConvertFlatMapToFlattenInspection
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).<caret>flatMap { i -> i }
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).flatten()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).flatMap<caret> { it + 1 }
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
setOf(setOf(1)).<caret>flatMap { it }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
setOf(setOf(1)).flatten()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).flatMap<caret> { it }
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).flatten()
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).flatMap<caret>({ it })
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
listOf(listOf(1)).flatten()
|
||||
}
|
||||
Reference in New Issue
Block a user