2501013012
ShortArrays are broken in the Parcelize JVM backend, which caused a frontend error on the JVM IR backend.
25 lines
539 B
Kotlin
Vendored
25 lines
539 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
// IGNORE_BACKEND: JVM
|
|
|
|
@file:JvmName("TestKt")
|
|
package test
|
|
|
|
import kotlinx.parcelize.*
|
|
import android.os.Parcel
|
|
import android.os.Parcelable
|
|
|
|
@Parcelize
|
|
class A(val value: ShortArray) : Parcelable
|
|
|
|
fun box() = parcelTest { parcel ->
|
|
val a = A(shortArrayOf(0, 1, 2, 3))
|
|
a.writeToParcel(parcel, 0)
|
|
|
|
val bytes = parcel.marshall()
|
|
parcel.unmarshall(bytes, 0, bytes.size)
|
|
parcel.setDataPosition(0)
|
|
|
|
val a2 = parcelableCreator<A>().createFromParcel(parcel)
|
|
assert(a.value.contentEquals(a2.value))
|
|
}
|