Parcelize: Add a test for KT-36658
This commit is contained in:
committed by
Alexander Udalov
parent
01ea2a641f
commit
aa0eeba327
+22
@@ -0,0 +1,22 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
// StackOverflowError caused by infinite loop in MyObject.writeToParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
@file:JvmName("TestKt")
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.*
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
private object MyObject : Parcelable
|
||||
|
||||
fun box() = parcelTest { parcel ->
|
||||
MyObject.writeToParcel(parcel, 0)
|
||||
|
||||
val bytes = parcel.marshall()
|
||||
parcel.unmarshall(bytes, 0, bytes.size)
|
||||
|
||||
readFromParcel<MyObject>(parcel)
|
||||
}
|
||||
Reference in New Issue
Block a user