Lucas
07/20/2022, 1:48 PMChris Lee
07/20/2022, 1:55 PMLucas
07/20/2022, 1:58 PMLucas
07/20/2022, 2:08 PMLucas
07/20/2022, 2:09 PMLucas
07/20/2022, 2:09 PMLucas
07/20/2022, 2:10 PMMR3Y
07/20/2022, 2:23 PMarrayOf(arrayOf(1))
isn't compiling as expected in your code unless you specify the exact same type Array<Array<Any?>>
explicitly because the type parameter of Array in Kotlin is invariant, it is actually declared as Array<T>
not Array<out T>
, the latter is equivalent to Array<? extends T>
Source: https://github.com/JetBrains/kotlin/blob/ea836fd46a1fef07d77c96f9d7e8d7807f793453/core/builtins/native/kotlin/Array.kt#L15