New Intention Action: Replace a call to forEach function with for loop.
Replaces an expression of form x.forEach { … } with for (a in x) { … }.
This commit is contained in:
committed by
Mikhael Bogdanov
parent
bd056d037f
commit
dbb28c571b
@@ -0,0 +1,11 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
class Foo {
|
||||
fun forEach(predicate: (Int) -> Int, bar: Int): Int = predicate(bar)
|
||||
}
|
||||
|
||||
fun main() {
|
||||
val x = Foo()
|
||||
|
||||
<caret>x.forEach({ it * 2 }, 2)
|
||||
}
|
||||
Reference in New Issue
Block a user