Can someone explain why this works? ```fun listOfA...
# announcements
m
Can someone explain why this works?
Copy code
fun listOfArrays(): List<Array<Any>> {
  return listOf(arrayOf("1", 0))
}
But not this?
Copy code
fun listOfArrays(): List<Array<Any>> {
  // Type mismatch: inferred type is List<Array<out {Comparable<*> & java.io.Serializable}>> but List<Array<Any>> was expected
  return listOf(arrayOf("1", 0)).map { it }
}
l
Probably a type inference bug that is worth reporting on kotl.in/issue if it's reproducible in 1.4.20-M1.
m
It's with
1.4.10
, I'll try
1.4.20-M1
👍
My initial sample was wrong, it missed a layer of
List<>
. I just updated it but that doesn't change the issue. I filed https://youtrack.jetbrains.com/issue/KT-42586
n
This looks a lot like the issue that caused plsusElement to be added
plus has some very weird behavior for lists of lists
i
No, it isn't related to KT-9992. Most likely it's the same problem as https://youtrack.jetbrains.com/issue/KT-17115, where compiler is unable to infer types in a chain of method calls.
👍 1