> Compiler should be smart enough to understand...
# stdlib
d
Compiler should be smart enough to understand the lambda values are
Boolean
, no?
No. Lambda in
listOf(true, null, false, true).mapNotNull { !it }
takes list elements (which are
Boolean?
). Meaning of
mapNotNull
is not "skip null elements in the original container", but "skip null elements in the resulting container".