[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:
Brian Norman
2023-11-07 13:59:17 -06:00
committed by Space Team
parent d5fe86559d
commit 0d36462c58
4 changed files with 32 additions and 16 deletions
@@ -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<!> {}
}