diesieben07
06/24/2019, 10:13 AMtypeOf
intrinsic does not retain type annotations. Is this intended or a bug?elizarov
06/24/2019, 10:31 AMdiesieben07
06/24/2019, 10:36 AMtypeOf
, but it's another nail in the coffin for type annotations. They are not retained for Java reflection and even the previous workaround for typeOf
(anonymous object in an inline function) does not retain them.diesieben07
06/24/2019, 10:36 AMelizarov
06/24/2019, 10:40 AMelizarov
06/24/2019, 10:41 AMtypeOf
operator)diesieben07
06/24/2019, 11:24 AMtypeOf
(yet?), but what I would love to be able to do is something like:
val x: List<@SomeValidation String>
diesieben07
06/24/2019, 11:25 AMinit
(or an internal constructor) that would solve that validation issue.
But in general it's sad that the annotations are supported in the language, but only half.Paul Woitaschek
06/24/2019, 12:06 PMPaul Woitaschek
06/24/2019, 12:06 PM@CheckReturnValue public <T> JsonAdapter<T> adapter(Type type) {
return adapter(type, Util.NO_ANNOTATIONS);
}
jw
06/24/2019, 2:11 PMelizarov
06/24/2019, 5:00 PMdiesieben07
06/26/2019, 6:46 AMelizarov
06/26/2019, 7:22 AMdiesieben07
06/26/2019, 7:26 AM