Files
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

41 lines
874 B
Kotlin
Vendored

// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>
// WITH_STDLIB
// FILE: KotlinParcelable.kt
package k
import android.os.*
data class KotlinParcelable(var data: Int): Parcelable {
override fun describeContents() = 1
override fun writeToParcel(dest: Parcel, flags: Int) {
dest.writeInt(data)
}
companion object {
@JvmField
val CREATOR = Creator()
}
class Creator : Parcelable.Creator<KotlinParcelable> {
override fun createFromParcel(source: Parcel): KotlinParcelable {
val data = source.readInt()
return KotlinParcelable(data)
}
override fun newArray(size: Int) = arrayOfNulls<KotlinParcelable>(size)
}
}
// FILE: test.kt
package test
import kotlinx.parcelize.*
import android.os.*
import k.*
@Parcelize
class Foo(val kp: KotlinParcelable): Parcelable