rocketraman
04/16/2020, 6:25 PMpublic <T> T deserialize(..., final Type type)
like this:
inline fun <reified T: Set<Any?>> deser(...): T? = deserialize(..., object : TypeToken<T>() {}.type)
and this used to work fine with 1.4-M1 / old inference. However, now I get a runtime error when the java code attempts to return its value to the Kotlin code:
Caused by: java.lang.ClassCastException: class java.util.LinkedHashSet cannot be cast to class java.lang.Void (java.util.LinkedHashSet and java.lang.Void are in module java.base of loader 'bootstrap')
I can "solve" this by explicitly adding the T
type to the deserialize call i.e. deserialize<T>(...)
, but I'm wondering if this is a bug with the new type inference? The compiler does not report any errors if the <T>
is left off.mikhail.zarechenskiy
04/17/2020, 9:54 AMrocketraman
04/17/2020, 1:21 PMrocketraman
04/17/2020, 2:20 PMrocketraman
04/17/2020, 8:01 PMmikhail.zarechenskiy
04/23/2020, 10:52 AMrocketraman
04/23/2020, 3:42 PM