c6d6a32314
Kotlin's function literals have a shortcut for one-argument literals:
the single argument doesn't need to be explicitly named, but can be
referred via the 'it' contextual keyword.
For example, 'array(1, 2, 3).filter { x -> x % 2 == 0 }'
-> 'array(1, 2, 3).filter { it % 2 == 0 }'
Add an intention action for this transformation.
5 lines
132 B
Kotlin
Vendored
5 lines
132 B
Kotlin
Vendored
// IS_APPLICABLE: false
|
|
|
|
fun call2(f: (Int, Int) -> Int, x: Int, y: Int) = f(x, y)
|
|
val foo = call2({ <caret>x, y -> x + y }, 40, 2)
|