[Parcelize] WriteWith Parceler type argument must be subtype of property
K2 checks that the entire Parceler of the WriteWith annotation is a subtype of the expected Parceler for the property, while K1 only checks that the type argument of the WriteWith Parceler is a subtype of the property type. This mismatch leads to inconsistencies between K1 and K2 diagnostic reporting. Switch K2 to K1 behavior so diagnostics are consistent. ^KT-60019 Fixed
This commit is contained in:
+6
-1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
package test
|
||||
|
||||
@@ -18,6 +19,8 @@ object CharSequenceParceler : Parceler<CharSequence> {
|
||||
override fun CharSequence.write(parcel: Parcel, flags: Int) = TODO()
|
||||
}
|
||||
|
||||
typealias CharSequenceParcelerAlias = CharSequenceParceler
|
||||
|
||||
class StringClassParceler : Parceler<String> {
|
||||
override fun create(parcel: Parcel) = TODO()
|
||||
override fun String.write(parcel: Parcel, flags: Int) = TODO()
|
||||
@@ -46,7 +49,9 @@ class Test(
|
||||
val b: @WriteWith<StringParceler> String,
|
||||
val c: @WriteWith<<!PARCELER_TYPE_INCOMPATIBLE!>StringParceler<!>> CharSequence,
|
||||
val d: @WriteWith<CharSequenceParceler> String,
|
||||
val e: @WriteWith<CharSequenceParceler> CharSequence
|
||||
val e: @WriteWith<CharSequenceParceler> CharSequence,
|
||||
val f: @WriteWith<CharSequenceParcelerAlias> String,
|
||||
val g: @WriteWith<CharSequenceParcelerAlias> CharSequence,
|
||||
) : Parcelable
|
||||
|
||||
@Parcelize
|
||||
|
||||
Reference in New Issue
Block a user