You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot assign an empty map literal to a declaration of type Map. This is part of a larger issue that invariant type parameters are replaced by a fixed type.
It's OK to replace covariant type parameters by Nothing and contravariant type parameters by Any?.
To Reproduce
Check this code:
fun f(
p: Map<String, Int> = {}
)
Expected behavior
The assignment should work. We could either try to infer a type from the context or remember a special type like Unbound that is compatible to everything.
Screenshots (optional)
No response
Additional Context (optional)
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Cannot assign an empty map literal to a declaration of type
Map
. This is part of a larger issue that invariant type parameters are replaced by a fixed type.It's OK to replace covariant type parameters by
Nothing
and contravariant type parameters byAny?
.To Reproduce
Check this code:
Expected behavior
The assignment should work. We could either try to infer a type from the context or remember a special type like
Unbound
that is compatible to everything.Screenshots (optional)
No response
Additional Context (optional)
No response
The text was updated successfully, but these errors were encountered: