ageery
02/29/2020, 4:50 PMval xyz: Map<String, (String) -> Unit> = mapOf("abc" to { it -> println(it.length) })
with a suggestion that there is a 'redundant lambda arrow' (the it ->
part in the lambda in the map key).
However, if I remove that portion, I get a 'type inference failed' compile error. The compiler interprets the lambda as () -> ???
rather than (String) -> Unit
. Shouldn't the compiler interpret { println(it.length) }
as satisfying (String) -> Unit
?Mike
02/29/2020, 5:30 PMit
, you won't get the warning.