[FIR] Don't miss diagnostics passed to @Suppress as names = []

In these cases we have a `FirVarargArgumentsExpression`
with a `FirNamedArgumentExpression` inside as its first
argument, which, in turn, has a `FirArrayLiteral`
argument.

^KT-62146 Fixed
This commit is contained in:
Nikolay Lunyak
2023-10-05 16:10:05 +03:00
committed by Space Team
parent 598b5dbdf4
commit 54285736d0
3 changed files with 5 additions and 14 deletions
@@ -180,7 +180,10 @@ fun List<FirAnnotation>.getAnnotationByClassIds(classIds: Collection<ClassId>, s
fun FirExpression.unwrapVarargValue(): List<FirExpression> {
return when (this) {
is FirVarargArgumentsExpression -> arguments
is FirVarargArgumentsExpression -> when (val first = arguments.firstOrNull()) {
is FirWrappedArgumentExpression -> first.expression.unwrapVarargValue()
else -> arguments
}
is FirArrayLiteral -> arguments
else -> listOf(this)
}