what is the kotlin equivalent of `Map<Class, Ob...
# getting-started
t
what is the kotlin equivalent of
Map<Class, Object>
? intellij suggests both
Map<Class<Any>, Any>
and
Map<Class<*>, Any>
as parameter type, but neither work when calling the method from java
i guess adding
<?>
to the java version is the answer 🤔 `
d
Yes,
Class
is a legacy raw type and should not be used in Java. Kotlin does not support them.
a
See https://youtrack.jetbrains.com/issue/KT-30363#focus=streamItem-27-3344960.0-0 for examples of
Map
interop with Java and a little explanation.