The reason that I'm asking is that we have such us...
# announcements
b
The reason that I'm asking is that we have such use-case, parse JSON and doesn't know the type of generics so we need to use
Operator<*>
. Jackson automatically parse the string into the appropriate class for that Operator so we're sure that it will work. What's the alternative approach to this use-case in Kotlin?
p
Just write
Copy code
val testImp = TestOperator() as Operator<Any?>
and it will fail in runtime if type is not correct in the same way as in Java.