Lisandro Di Meo
01/13/2023, 1:17 PMonSomething { (key,value) : Map<K,V> -> ... }
CLOVIS
01/13/2023, 1:21 PMmapOf(
"1" to 1,
"2" to 2,
).forEach { (key, value) ->
println("$key → $value")
}
Pattern matching implies some kind of conditional, it's not the case in KotlinCLOVIS
01/13/2023, 1:22 PMval map = mapOf(…)
for ((key, value) in map) {
…
}
https://kotlinlang.org/docs/destructuring-declarations.htmlLisandro Di Meo
01/13/2023, 1:26 PMDestructuring declaration initializer of type Map<String, Boolean>! must have a 'component2()' function
CLOVIS
01/13/2023, 1:27 PMMap
, you're using java.util.Map
but you should be using kotlin.Map
CLOVIS
01/13/2023, 1:29 PM!
in the type is a platform type (https://kotlinlang.org/docs/java-to-kotlin-nullability-guide.html#platform-types), it means you're using a type that comes from some other language (in your case, Java) which has missing informationLisandro Di Meo
01/13/2023, 1:29 PMLisandro Di Meo
01/13/2023, 1:30 PMLisandro Di Meo
01/13/2023, 1:30 PMCLOVIS
01/13/2023, 1:31 PMCLOVIS
01/13/2023, 1:31 PMLisandro Di Meo
01/13/2023, 1:38 PMaMap.mapValues { (aMapKey, aMapValue) ->
...
}
Lisandro Di Meo
01/13/2023, 1:38 PMJoffrey
01/13/2023, 3:56 PMLisandro Di Meo
01/13/2023, 6:46 PM