Introduce inspection for determining if a forEach parameter is unused
#KT-22068 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
c3b2d1829f
commit
e81eee4cc1
@@ -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) {}
|
||||
Reference in New Issue
Block a user