[FE] Don't report cycle on annotation parameters if argument is vararg or array

^KT-52742 Fixed
^KT-47932
This commit is contained in:
Dmitriy Novozhilov
2022-06-14 13:37:29 +03:00
committed by teamcity
parent 4775855fd7
commit 12ce433bc2
12 changed files with 60 additions and 7 deletions
@@ -192,6 +192,7 @@ object FirAnnotationClassDeclarationChecker : FirRegularClassChecker() {
fun parameterHasCycle(ownedAnnotation: FirRegularClassSymbol, parameter: FirValueParameterSymbol): Boolean {
val returnType = parameter.resolvedReturnTypeRef.coneType
return when {
parameter.isVararg || returnType.isNonPrimitiveArray -> false
returnType.typeArguments.isNotEmpty() -> {
if (returnType.classId == StandardClassIds.KClass) return false
for (argument in returnType.typeArguments) {