Call chain --> Sequence: don't report if first call is 'groupingBy'

#KT-27104 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-09-27 08:26:32 +03:00
committed by Mikhail Glukhikh
parent b500239bd1
commit 8fc5fefc7f
5 changed files with 27 additions and 0 deletions
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun test(list: List<Int>) {
list.<caret>map { it * 2 }.map { it * 3 }.map { it * 4 }.groupingBy { it }
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun test(list: List<Int>) {
list.asSequence().map { it * 2 }.map { it * 3 }.map { it * 4 }.groupingBy { it }
}
@@ -0,0 +1,6 @@
// PROBLEM: none
// WITH_RUNTIME
fun test(list: List<Int>) {
list.<caret>groupingBy { it }.reduce { _, acc, _ -> acc }
}