`remove` returns the value of the entry removed or...
# announcements
s
remove
returns the value of the entry removed or null if nothing was removed
k
Put
<K, V: Any>
as the function's generic type to make V non-nullable.
s
Ah, I see, that's a result of
<T, R : Any> Iterable<T>.mapNotNull
?
k
Yup, and on a higher level, it's really needed to guarantee
mapNotNull
can work as expected.
Your function wouldn't work if someone calls it with a nullable type argument.
s
Makes sense!