Parcelize: Check @IgnoredOnParcel annotation usage (#KT-24459)
This commit is contained in:
Vendored
+17
-1
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.android.parcel.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
@@ -18,3 +18,19 @@ class A(val firstName: String) : Parcelable {
|
||||
get() = ""
|
||||
set(<warning descr="[UNUSED_PARAMETER] Parameter 'v' is never used">v</warning>) {}
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
@Suppress("WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET")
|
||||
class B(<warning descr="[PLUGIN_WARNING] '@IgnoredOnParcel' is inapplicable to properties declared in the primary constructor">@IgnoredOnParcel</warning> val firstName: String) : Parcelable {
|
||||
@IgnoredOnParcel
|
||||
var a: String = ""
|
||||
|
||||
@field:IgnoredOnParcel
|
||||
var <warning descr="[PLUGIN_WARNING] Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning">b</warning>: String = ""
|
||||
|
||||
@get:IgnoredOnParcel
|
||||
var <warning descr="[PLUGIN_WARNING] Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning">c</warning>: String = ""
|
||||
|
||||
@set:IgnoredOnParcel
|
||||
var <warning descr="[PLUGIN_WARNING] Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning">d</warning>: String = ""
|
||||
}
|
||||
Reference in New Issue
Block a user