The following code produces a false positive "usel...
# intellij
k
The following code produces a false positive "useless cast" warning for `as MutableList<String>`:
Copy code
val map = (0..3).associateWithTo(mutableMapOf()) { ArrayList<String>() as MutableList<String> }
    val groups = listOf("a", "aa").groupByTo(map) { it.length }
Removing the "useless cast" causes a compiler error. Looking at existing logged issues, is this the same issue as KT-36281?
(This is a bit contrived, by the way. I know there are other ways of writing it.)
a
@Klitos Kyriacou can you please create a new Youtrack ticket? Thank you!