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
louiscad
10/10/2020, 9:26 AM
Probably a type inference bug that is worth reporting on kotl.in/issue if it's reproducible in 1.4.20-M1.
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.