Parcelable: Do not check property types if the Parcelable class has a custom Parceler implementation (KT-20062)
This commit is contained in:
committed by
Yan Zhulanow
parent
89c5f78a8e
commit
033386b47d
@@ -27,5 +27,6 @@
|
||||
<orderEntry type="module" module-name="backend" />
|
||||
<orderEntry type="module" module-name="android-extensions-runtime" />
|
||||
<orderEntry type="module" module-name="idea-gradle" />
|
||||
<orderEntry type="module" module-name="kapt3-idea" scope="TEST" />
|
||||
</component>
|
||||
</module>
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
package test
|
||||
|
||||
import kotlinx.android.parcel.*
|
||||
import android.os.*
|
||||
|
||||
class Box(val value: String)
|
||||
|
||||
@Parcelize
|
||||
class Foo(val box: Box): Parcelable {
|
||||
companion object : Parceler<Foo> {
|
||||
override fun create(parcel: Parcel) = Foo(Box(parcel.readString()))
|
||||
|
||||
override fun Foo.write(parcel: Parcel, flags: Int) {
|
||||
parcel.writeString(box.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
class Foo2(val box: <error descr="[PLUGIN_ERROR] 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()'">Box</error>): Parcelable
|
||||
+6
@@ -66,6 +66,12 @@ public class ParcelCheckerTestGenerated extends AbstractParcelCheckerTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt20062.kt")
|
||||
public void testKt20062() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-idea/testData/android/parcel/checker/kt20062.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("modality.kt")
|
||||
public void testModality() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("plugins/android-extensions/android-extensions-idea/testData/android/parcel/checker/modality.kt");
|
||||
|
||||
Reference in New Issue
Block a user