[parcelize] Fix codegen for generic classes

Replace type arguments with star projection in static methods
Fix IR function generation

^KT-42652  Fixed
This commit is contained in:
Andrey Zinovyev
2021-02-04 15:11:51 +03:00
committed by GitHub
parent ca02573d1e
commit 95140f35f8
10 changed files with 204 additions and 3 deletions
@@ -0,0 +1,27 @@
// WITH_RUNTIME
@file:JvmName("TestKt")
package test
import kotlinx.parcelize.*
import android.os.Parcel
import android.os.Parcelable
@Parcelize
data class Foo(val value: Int) : Parcelable
@Parcelize
data class Box<T : Parcelable>(val box: T) : Parcelable
fun box() = parcelTest { parcel ->
val foo = Foo(42)
val box = Box(foo)
box.writeToParcel(parcel, 0)
val bytes = parcel.marshall()
parcel.unmarshall(bytes, 0, bytes.size)
parcel.setDataPosition(0)
val boxLoaded = readFromParcel<Box<Foo>>(parcel)
assert(box == boxLoaded)
}