Introduce inspection for determining if a forEach parameter is unused

#KT-22068 Fixed
This commit is contained in:
Dennis Cornwell
2018-07-29 23:35:23 +03:00
committed by Mikhail Glukhikh
parent c3b2d1829f
commit e81eee4cc1
14 changed files with 197 additions and 0 deletions
@@ -0,0 +1,11 @@
fun test() {
val items = listOf<Any>()
items.forEach { }
items.forEach { item -> }
items.forEach { doSomething(it) }
items.forEach { item -> doSomething(item) }
items.forEach { items.forEach { doSomething(it) } }
items.forEach { items.forEach { thing -> doSomething(it); doSomething(thing) } }
}
fun doSomething(item: Any) {}