https://kotlinlang.org logo
r

Ruckus

06/20/2019, 9:57 PM
I think I found another issue with the new type inference:
Copy code
fun fred(map: Map<String, Any?>) {
    ...
}

fun test() {
    fred(mapOf("a" to { x: Color -> x.grayValue() }, "b" to Color.BLUE))
}
The
{ x: Color -> x.grayValue()}
is marked as an error due to
Type mismatch
Required: Color
Found: (Color) -> UByte
But it compiles and runs fine
2 Views