Hey If I have a parameter defined as `test: KClass...
# announcements
f
Hey If I have a parameter defined as
test: KClass<Any>
how can I fix the problem that when for example passing in
MyClass::class
the type missmatch error?
s
you can either ignore the type completely using
*
as in
KClass<*>
, or use generics
Copy code
fun <T : Any> foo(test: KClass<T>)
which one you pick depends on your actual requirements
or, project
T
such that it relates to
MyClass
, but that’s for you to decide
s
test: KClass<out Any>
f
out any seems good. My problem is I am mixing jackson java with some kotlin which makes it a bit nasty in regards of Any type possible