if you want the resulting type to be `Map<Strin...
# getting-started
s
if you want the resulting type to be
Map<String, List<String>>
you’re probably going to have to do some casting
smart casting fails for the
is String
case - the compiler says
Copy code
Smart cast to 'String' is impossible, because 'it.value' is a property that has open or custom getter
b
it works if you use
{ (key, value) ->
s
ah, interesting that it doesn’t complain when you destructure, but ¯\_(ツ)_/¯
b
it makes sense, you are creating immutable copies, essentially
val key =
etc, so they can no longer change.