[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:
committed by
Space Team
parent
598b5dbdf4
commit
54285736d0
+4
-1
@@ -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)
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
// ISSUE: KT-62146
|
||||
|
||||
@Deprecated("This is deprecated", level = DeprecationLevel.WARNING)
|
||||
fun deprecated() = 1
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun main() = deprecated()
|
||||
|
||||
@Suppress(names = ["DEPRECATION"])
|
||||
fun plain() = <!DEPRECATION!>deprecated<!>()
|
||||
|
||||
@Suppress(names = arrayOf("DEPRECATION"))
|
||||
fun brain() = <!DEPRECATION!>deprecated<!>()
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-62146
|
||||
|
||||
@Deprecated("This is deprecated", level = DeprecationLevel.WARNING)
|
||||
|
||||
Reference in New Issue
Block a user