Maybe dumb question, but why is this giving me an ...
# announcements
o
Maybe dumb question, but why is this giving me an error?
d
Smart casts / type inference is simply not smart enough for that. The compiler cannot determine that
filterNot
will in fact return a Map with non-null values based on your filter function.
😥 1
g
You can vote for this feature https://youtrack.jetbrains.com/issue/KT-4734
🤩 1
For now you can do just unsafe cast or map key and values using mapNotNull