Call chain into sequence: fix false negative on Iterable
#KT-26650 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
2e5ee242c7
commit
9a725b99b2
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(i: Iterable<Int>): List<Int> {
|
||||
return i.<caret>filter { it > 1 }.map { it * 2 }
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(i: Iterable<Int>): List<Int> {
|
||||
return i.asSequence().filter { it > 1 }.map { it * 2 }.toList()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A<T>(private val list: List<T>) : Iterable<T> {
|
||||
override fun iterator(): Iterator<T> = list.iterator()
|
||||
}
|
||||
|
||||
fun test(i: A<Int>): List<Int> {
|
||||
return i.<caret>filter { it > 1 }.map { it * 2 }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
class A<T>(private val list: List<T>) : Iterable<T> {
|
||||
override fun iterator(): Iterator<T> = list.iterator()
|
||||
}
|
||||
|
||||
fun test(i: A<Int>): List<Int> {
|
||||
return i.asSequence().filter { it > 1 }.map { it * 2 }.toList()
|
||||
}
|
||||
Reference in New Issue
Block a user