Parcelable, minor: Rename MagicParcel to Parcelize
This commit is contained in:
Vendored
+7
-7
@@ -1,26 +1,26 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class A : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class B(val firstName: String, val secondName: String) : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class C(val firstName: String, <error descr="[PARCELABLE_CONSTRUCTOR_PARAMETER_SHOULD_BE_VAL_OR_VAR] 'Parcelable' constructor parameter should be 'val' or 'var'">secondName</error>: String) : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class D(val firstName: String, vararg val secondName: String) : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class E(val firstName: String, val secondName: String) : Parcelable {
|
||||
constructor() : this("", "")
|
||||
}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class <error descr="[PARCELABLE_SHOULD_HAVE_PRIMARY_CONSTRUCTOR] 'Parcelable' should have a primary constructor">F</error> : Parcelable {
|
||||
constructor(a: String) {
|
||||
println(a)
|
||||
|
||||
Vendored
+2
-2
@@ -1,10 +1,10 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
import android.os.Parcel
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class A(val a: String) : Parcelable {
|
||||
companion object {
|
||||
@JvmField
|
||||
|
||||
+4
-4
@@ -1,21 +1,21 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
import android.os.Parcel
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class A(val a: String) : Parcelable {
|
||||
<error descr="[OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED] Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead.">override</error> fun writeToParcel(p: Parcel?, flags: Int) {}
|
||||
override fun describeContents() = 0
|
||||
}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class B(val a: String) : Parcelable {
|
||||
<error descr="[OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED] Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead.">override</error> fun writeToParcel(p: Parcel?, flags: Int) {}
|
||||
}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class C(val a: String) : Parcelable {
|
||||
<error descr="[OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED] Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead.">override</error> fun writeToParcel(p: Parcel, flags: Int) {}
|
||||
}
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
import android.os.Parcel
|
||||
|
||||
@@ -9,5 +9,5 @@ open class Delegate : Parcelable {
|
||||
override fun describeContents() = 0
|
||||
}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class Test : Parcelable <error descr="[PARCELABLE_DELEGATE_IS_NOT_ALLOWED] Delegating 'Parcelable' is now allowed">by</error> Delegate()
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class User : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class <warning descr="[PARCELABLE_PRIMARY_CONSTRUCTOR_IS_EMPTY] The primary constructor is empty, no data will be serialized to 'Parcel'">User2</warning>() : Parcelable
|
||||
Vendored
+8
-8
@@ -1,31 +1,31 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
open class Open(val foo: String) : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class Final(val foo: String) : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
<error descr="[PARCELABLE_SHOULD_BE_INSTANTIABLE] 'Parcelable' should not be a 'sealed' or 'abstract' class">abstract</error> class Abstract(val foo: String) : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
<error descr="[PARCELABLE_SHOULD_BE_INSTANTIABLE] 'Parcelable' should not be a 'sealed' or 'abstract' class">sealed</error> class Sealed(val foo: String) : Parcelable {
|
||||
class X : Sealed("")
|
||||
}
|
||||
|
||||
class Outer {
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
<error descr="[PARCELABLE_CANT_BE_INNER_CLASS] 'Parcelable' can't be an inner class">inner</error> class Inner(val foo: String) : Parcelable
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
<error descr="[PARCELABLE_SHOULD_BE_CLASS] 'Parcelable' should be a class">object</error> : Parcelable {}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class <error descr="[NO_PARCELABLE_SUPERTYPE] No 'Parcelable' supertype"><error descr="[PARCELABLE_CANT_BE_LOCAL_CLASS] 'Parcelable' can't be a local class">Local</error></error> {}
|
||||
}
|
||||
plugins/android-extensions/android-extensions-idea/testData/android/parcel/checker/notMagicParcel.kt
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class A(val firstName: String) : Parcelable {
|
||||
val <warning descr="[PROPERTY_WONT_BE_SERIALIZED] Property would not be serialized into a 'Parcel'. Add '@Transient' annotation to it">secondName</warning>: String = ""
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class User(val firstName: String, val secondName: String, val age: Int) : Parcelable
|
||||
+5
-5
@@ -1,15 +1,15 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.android.parcel.RawValue
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class User(
|
||||
val a: String,
|
||||
val b: <error descr="[PARCELABLE_TYPE_NOT_SUPPORTED] Type is not directly supported by 'MagicParcelable'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'">Any</error>,
|
||||
val c: <error descr="[PARCELABLE_TYPE_NOT_SUPPORTED] Type is not directly supported by 'MagicParcelable'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'">Any?</error>,
|
||||
val d: <error descr="[PARCELABLE_TYPE_NOT_SUPPORTED] Type is not directly supported by 'MagicParcelable'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'">Map<Any, String></error>,
|
||||
val b: <error descr="[PARCELABLE_TYPE_NOT_SUPPORTED] Type is not directly supported by 'Parcelize'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'">Any</error>,
|
||||
val c: <error descr="[PARCELABLE_TYPE_NOT_SUPPORTED] Type is not directly supported by 'Parcelize'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'">Any?</error>,
|
||||
val d: <error descr="[PARCELABLE_TYPE_NOT_SUPPORTED] Type is not directly supported by 'Parcelize'. Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'">Map<Any, String></error>,
|
||||
val e: @RawValue Any?,
|
||||
val f: @RawValue Map<String, Any>,
|
||||
val g: Map<String, @RawValue Any>,
|
||||
|
||||
+5
-5
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class <error descr="[NO_PARCELABLE_SUPERTYPE] No 'Parcelable' supertype">Without</error>(val firstName: String, val secondName: String, val age: Int)
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class With(val firstName: String, val secondName: String, val age: Int) : Parcelable
|
||||
|
||||
interface MyParcelableIntf : Parcelable
|
||||
|
||||
abstract class MyParcelableCl : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class WithIntfSubtype(val firstName: String, val secondName: String, val age: Int) : MyParcelableIntf
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
class WithClSubtype(val firstName: String, val secondName: String, val age: Int) : MyParcelableCl()
|
||||
+6
-6
@@ -1,25 +1,25 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.MagicParcel
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
import android.os.Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
interface <error descr="[PARCELABLE_SHOULD_BE_CLASS] 'Parcelable' should be a class">Intf</error> : Parcelable
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
object <error descr="[PARCELABLE_SHOULD_BE_CLASS] 'Parcelable' should be a class">Obj</error>
|
||||
|
||||
class A {
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
companion <error descr="[PARCELABLE_SHOULD_BE_CLASS] 'Parcelable' should be a class">object</error> {
|
||||
fun foo() {}
|
||||
}
|
||||
}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
enum class <error descr="[PARCELABLE_SHOULD_BE_CLASS] 'Parcelable' should be a class">Enum</error> {
|
||||
WHITE, BLACK
|
||||
}
|
||||
|
||||
@MagicParcel
|
||||
@Parcelize
|
||||
annotation class <error descr="[PARCELABLE_SHOULD_BE_CLASS] 'Parcelable' should be a class">Anno</error>
|
||||
Reference in New Issue
Block a user