[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:
@@ -122,10 +122,6 @@ private val USE_SITE_TARGET_NAME_MAP = mapOf(
|
||||
private val DEFAULT_USE_SITE_TARGETS: Set<AnnotationUseSiteTarget> =
|
||||
USE_SITE_TARGET_NAME_MAP.values.fold(setOf<AnnotationUseSiteTarget>()) { a, b -> a + b } - setOf(AnnotationUseSiteTarget.FILE)
|
||||
|
||||
fun FirDeclaration.hasAnnotation(type: ConeClassLikeType, session: FirSession): Boolean {
|
||||
return annotations.hasAnnotation(type, session)
|
||||
}
|
||||
|
||||
fun FirDeclaration.hasAnnotation(classId: ClassId, session: FirSession): Boolean {
|
||||
return annotations.hasAnnotation(classId, session)
|
||||
}
|
||||
@@ -142,10 +138,6 @@ fun FirAnnotationContainer.hasAnnotation(classId: ClassId, session: FirSession):
|
||||
return annotations.hasAnnotation(classId, session)
|
||||
}
|
||||
|
||||
fun List<FirAnnotation>.hasAnnotation(type: ConeClassLikeType, session: FirSession): Boolean {
|
||||
return this.any { it.toAnnotationClassLikeType(session) == type }
|
||||
}
|
||||
|
||||
fun List<FirAnnotation>.hasAnnotation(classId: ClassId, session: FirSession): Boolean {
|
||||
return this.any { it.toAnnotationClassId(session) == classId }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user