hfhbd
02/19/2022, 12:47 PMkt
val m: Map<String, Int> = mapOf("a" to 42, "b" to null).filterValues { it != null }
Any possibility to infer the not null type by the compiler? Workaround is a manual castSam
02/19/2022, 12:56 PMVampire
02/19/2022, 12:59 PMSam
02/19/2022, 1:02 PMMap.get
is defined to return V?
, not `V`: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/get.htmlMap<String, Int>
and a Map<String, Int?>
👍Vampire
02/19/2022, 1:07 PM