Join Slack
Powered by
<Map.get accepts null keys - issue is stale> Hey, ...
# forum
r
rss
06/22/2023, 7:29 AM
Map.get accepts null keys - issue is stale
Hey, more than a year ago, I created this issue:
https://youtrack.jetbrains.com/issue/KT-52231/Map.get-accepts-null-keys-although-forbidden-by-type
In short: fun test() { val map = TreeMap() val key: String? = null val shouldNotCompile = map[key] } This code should not compile, because key of type String? cannot be cast to String. Yet, it...
Open in Slack
Previous
Next