Open
Description
Expected Behavior
The CouldBeSequence
rule should check for all standard lib collection functions that return a new collection instance.
Observed Behavior
Some functions are not accounted for even though they create a new collection and should be replaced by a sequence.
Steps to Reproduce
@Test
fun `all functions should be accounted for`() {
val code = """
val bar = listOf<String?>("bar")
.filterIsInstance<String>()
.filterNot { true }
.filterNotNull()
.take(1)
.drop(1)
.takeWhile { true }
.mapNotNull { it }
""".trimIndent()
assertThat(subject.lintWithContext(env, code)).hasSize(1)