Join Slack
Powered by
Maybe dumb question, but why is this giving me an ...
# announcements
o
Onur
01/16/2019, 1:27 PM
Maybe dumb question, but why is this giving me an error?
d
diesieben07
01/16/2019, 1:29 PM
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
gildor
01/16/2019, 1:38 PM
You can vote for this feature
https://youtrack.jetbrains.com/issue/KT-4734
🤩 1
gildor
01/16/2019, 1:40 PM
For now you can do just unsafe cast or map key and values using mapNotNull
Open in Slack
Previous
Next