[Parcelize] Align checker and generator on valid Parcelize classes
A previous fix to the generator made the generator and checker validation of classes which could be parcelized different. The checker would report error in cases where the generator would not generate anything. Align these checks, with improved code sharing, so errors are not reported on classes which will not have parcelize components generated. ^KT-63086 Fixed
This commit is contained in:
@@ -6,6 +6,8 @@ import android.os.Parcelable
|
||||
@Parcelize
|
||||
open class Open(val foo: String) : Parcelable
|
||||
|
||||
data class Derived(val bar: String) : Open(bar)
|
||||
|
||||
@Parcelize
|
||||
class Final(val foo: String) : Parcelable
|
||||
|
||||
@@ -29,6 +31,8 @@ fun foo() {
|
||||
@Parcelize
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED, PARCELABLE_SHOULD_BE_CLASS!>object<!> : Parcelable {}
|
||||
|
||||
object : Open("") {}
|
||||
|
||||
@Parcelize
|
||||
class <!NO_PARCELABLE_SUPERTYPE, PARCELABLE_CANT_BE_LOCAL_CLASS!>Local<!> {}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import android.os.Parcelable
|
||||
@Parcelize
|
||||
open class Open(val foo: String) : Parcelable
|
||||
|
||||
data class Derived(val bar: String) : Open(bar)
|
||||
|
||||
@Parcelize
|
||||
class Final(val foo: String) : Parcelable
|
||||
|
||||
@@ -29,6 +31,8 @@ fun foo() {
|
||||
@Parcelize
|
||||
<!PARCELABLE_CANT_BE_LOCAL_CLASS!>object<!> : Parcelable {}
|
||||
|
||||
object : Open("") {}
|
||||
|
||||
@Parcelize
|
||||
class <!NO_PARCELABLE_SUPERTYPE, PARCELABLE_CANT_BE_LOCAL_CLASS!>Local<!> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user