[FIR] KT-57247: Expand typealiases in annotation vararg arguments
^KT-57247 Fixed
This commit is contained in:
committed by
Space Team
parent
5b0b7c4da4
commit
4b8471d806
+4
-5
@@ -101,7 +101,7 @@ object FirAnnotationClassDeclarationChecker : FirRegularClassChecker() {
|
||||
// DO NOTHING: arrays of unsigned types are allowed
|
||||
}
|
||||
classId == StandardClassIds.Array -> {
|
||||
if (!isAllowedArray(typeRef, context.session))
|
||||
if (!isAllowedArray(coneType, context.session))
|
||||
reporter.reportOn(typeRef.source, FirErrors.INVALID_TYPE_OF_ANNOTATION_MEMBER, context)
|
||||
}
|
||||
isAllowedClassKind(coneType, context.session) -> {
|
||||
@@ -137,13 +137,12 @@ object FirAnnotationClassDeclarationChecker : FirRegularClassChecker() {
|
||||
return typeRefClassKind == ANNOTATION_CLASS || typeRefClassKind == ENUM_CLASS
|
||||
}
|
||||
|
||||
private fun isAllowedArray(typeRef: FirTypeRef, session: FirSession): Boolean {
|
||||
val typeArguments = typeRef.coneType.typeArguments
|
||||
private fun isAllowedArray(type: ConeKotlinType, session: FirSession): Boolean {
|
||||
val typeArguments = type.typeArguments
|
||||
|
||||
if (typeArguments.size != 1) return false
|
||||
|
||||
val arrayType = (typeArguments[0] as? ConeKotlinTypeProjection)
|
||||
?.type
|
||||
val arrayType = (typeArguments[0] as? ConeKotlinTypeProjection)?.type?.fullyExpandedType(session)
|
||||
?: return false
|
||||
|
||||
if (arrayType.isNullable) return false
|
||||
|
||||
Reference in New Issue
Block a user