Introduce "Useless call on collection type" inspection

Related to KT-12165
Supported functions: filterNotNull, filterIsInstance,
mapNotNull, mapNotNullTo, mapIndexedNotNull, mapIndexedNotNullTo

Also, "Useless cal on not-null" improved a bit
This commit is contained in:
Mikhail Glukhikh
2017-06-19 16:00:30 +03:00
parent f80f41d254
commit bdb9f00c75
32 changed files with 411 additions and 73 deletions
@@ -0,0 +1,6 @@
// PROBLEM: none
// WITH_RUNTIME
fun String.toNullableInt(): Int? = null
val x = listOf("1").<caret>mapNotNull(String::toNullableInt)