This is because `*` isn't a type. It's a projectio...
# getting-started
o
This is because
*
isn't a type. It's a projection. It can be used as a substitute for a generic type parameter, but it cannot be used as a parameter type in a function. But, as we've noted,
*
is basically syntax sugar. When used in place of a contravariant (
in
) type parameter, it means
in Nothing
. And parameter types in function types are always contravariant. So
(Nothing) -> Unit
is exactly equivalent to
Function1<*, Unit>
. Because
Function1<*, Unit>
is exactly equivalent to
Function1<Nothing, Unit>
.
🤔 4