Parcelize: Add IDE support for the Parcelize compiler plugin with sources extracted from Android Extensions plugin (KT-40030)

This commit is contained in:
Yan Zhulanow
2020-07-07 19:35:26 +09:00
parent b7796d63d8
commit 15b2850ee0
85 changed files with 2473 additions and 2 deletions
@@ -0,0 +1,29 @@
// "Remove custom ''writeToParcel()'' function" "true"
// ERROR: 'CREATOR' definition is not allowed. Use 'Parceler' companion object instead
// WITH_RUNTIME
package com.myapp.activity
import android.os.*
import kotlinx.parcelize.Parcelize
@Parcelize
class Foo(val a: String) : Parcelable {
constructor(parcel: Parcel) : this(parcel.readString()) {
}
<caret>override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<Foo> {
override fun createFromParcel(parcel: Parcel): Foo {
return Foo(parcel)
}
override fun newArray(size: Int): Array<Foo?> {
return arrayOfNulls(size)
}
}
}