Simplifiable call inspection: add filter -> filterIsInstance replacement

#KT-30501 Fixed
This commit is contained in:
Mikhail Glukhikh
2019-05-06 13:26:19 +03:00
parent 7f1643cfad
commit e934eba6e4
5 changed files with 49 additions and 18 deletions
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(list: List<Any>) {
list.<caret>filter { it is String }
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(list: List<Any>) {
list.filterIsInstance<String>()
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
// PROBLEM: none
fun test(list: List<Any>) {
list.<caret>filter { it !is String }
}