[Parcelize] Detect redundant TypeParceler when type aliases are used

Make sure redundancies between class and property TypeParceler
annotations are detected when a type alias is used. This requires
checking the expanded type arguments of the annotation, as just
comparing the cone types is not sufficient because the type arguments
are not expanded.

^KT-64979 Fixed
This commit is contained in:
Brian Norman
2024-01-15 10:36:48 -06:00
committed by Space Team
parent 20340f94d4
commit eded51a0f5
3 changed files with 18 additions and 17 deletions
@@ -1,6 +1,4 @@
// WITH_STDLIB
// fir doesn't support annotations with type arguments
// IGNORE_BACKEND_K2: JVM_IR
@file:JvmName("TestKt")
package test
@@ -32,8 +30,8 @@ object Parceler3 : Parceler<String> {
data class Test(
val a: String,
@<!REDUNDANT_TYPE_PARCELER!>TypeParceler<!><String, Parceler1> val b: String,
@TypeParceler<String, Parceler3> val c: CharSequence,
val d: @WriteWith<Parceler3> String
@TypeParceler<String, Parceler3> val c: CharSequence,
val d: @WriteWith<Parceler3> String,
) : Parcelable
fun box() = parcelTest { parcel ->