You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run the null validation in containsIllegalNullValues on a nullable list, e.g.:
val nullableListWithNull = listOf<String?>(null)
then it will return false, because on iterating through the list, element is null. This may seem like an odd scenario but we experience it when using Gson with a custom deserialiser that ignores certain elements, for which it returns null.
If you run the null validation in
containsIllegalNullValues
on a nullable list, e.g.:val nullableListWithNull = listOf<String?>(null)
then it will return false, because on iterating through the list,
element
is null. This may seem like an odd scenario but we experience it when using Gson with a custom deserialiser that ignores certain elements, for which it returns null.I did look at whether it was possible to improve on this, e.g. examine the return type of the collection's iterator to see if
isMarkedNullable
would be true, but I couldn't find a working solution. I think this a product of how Kotlin does generics, e.g. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-type/is-marked-nullable.htmlThe text was updated successfully, but these errors were encountered: