[Parcel] Expand types from TypeParceler annotation to support aliases

Class properties are being expanded before checking for custom
parcelers, which makes custom parcelers of type alias unable to be
found. To maintain K1 behavior, the custom parceler type must also be
expanded, so even the aliased type is supported when used in its raw
form as a class property.

^KT-64707 Fixed
This commit is contained in:
Brian Norman
2024-01-04 09:43:21 -06:00
committed by Space Team
parent 55bff799a8
commit 9ec469e3c3
3 changed files with 67 additions and 1 deletions
@@ -80,7 +80,7 @@ object FirParcelizePropertyChecker : FirPropertyChecker() {
private fun getCustomParcelerTypes(annotations: List<FirAnnotation>, session: FirSession): Set<ConeKotlinType> =
annotations.mapNotNullTo(mutableSetOf()) { annotation ->
if (annotation.fqName(session) in ParcelizeNames.TYPE_PARCELER_FQ_NAMES && annotation.typeArguments.size == 2) {
annotation.typeArguments[0].toConeTypeProjection().type
annotation.typeArguments[0].toConeTypeProjection().type?.fullyExpandedType(session)
} else {
null
}