Closed
Description
Expected Behavior of the rule
This example, from the Kotlin docs, is not flagged by FunctionNaming rule at fun(value: Int)
:
fun foo() {
listOf(1, 2, 3, 4, 5).forEach(fun(value: Int) {
if (value == 3) return // local return to the caller of the anonymous fun, i.e. the forEach loop
print(value)
})
print(" done with anonymous function")
}
Context
Anonymous functions by definition do not have a name.