Parcelize: Check @IgnoredOnParcel annotation usage (#KT-24459)

This commit is contained in:
Yan Zhulanow
2018-05-22 01:54:01 +03:00
parent ee37bcf14b
commit 3c1c776cdb
4 changed files with 43 additions and 1 deletions
@@ -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 = ""
}