8ce0d43118
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. Add an intention action for
converting an implicit 'it' parameter to an explicitly named one.
For example, 'array(1, 2, 3).filter { it % 2 == 0 }'
-> 'array(1, 2, 3).filter { x -> x % 2 == 0 }'
4 lines
89 B
Kotlin
Vendored
4 lines
89 B
Kotlin
Vendored
// IS_APPLICABLE: false
|
|
fun foo(i: (Int) -> Int) = 0
|
|
val x = foo { it -> i<caret>t + 1 }
|