[FIR] KT-53435: Fix false positive ANNOTATION_ARGUMENT_MUST_BE_CONST

Otherwise, `FirNamedArgumentExpression` are not considered
const expr despite the value.

Merge-request: KT-MR-7052
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
This commit is contained in:
Nikolay Lunyak
2022-09-07 12:34:26 +00:00
committed by Space
parent ff1adf596d
commit 45619ab390
7 changed files with 83 additions and 0 deletions
@@ -0,0 +1,43 @@
FILE: nestedAnnotationConstExprArguments.kt
public final annotation class InnerAnnotation : R|kotlin/Annotation| {
public constructor(text: R|kotlin/String|): R|InnerAnnotation| {
super<R|kotlin/Any|>()
}
public final val text: R|kotlin/String| = R|<local>/text|
public get(): R|kotlin/String|
}
public final annotation class OuterAnnotation : R|kotlin/Annotation| {
public constructor(inner: R|InnerAnnotation|): R|OuterAnnotation| {
super<R|kotlin/Any|>()
}
public final val inner: R|InnerAnnotation| = R|<local>/inner|
public get(): R|InnerAnnotation|
}
@R|OuterAnnotation|(inner = R|/InnerAnnotation.InnerAnnotation|(text = String(x).R|kotlin/String.plus|(String(x)))) public final class Payload : R|kotlin/Any| {
public constructor(): R|Payload| {
super<R|kotlin/Any|>()
}
}
@R|InnerAnnotation|(text = String(x).R|kotlin/String.plus|(String(x))) public final class Payload2 : R|kotlin/Any| {
public constructor(): R|Payload2| {
super<R|kotlin/Any|>()
}
}
@R|OuterAnnotation|(inner = R|/InnerAnnotation.InnerAnnotation|(text = String(x))) public final class Payload3 : R|kotlin/Any| {
public constructor(): R|Payload3| {
super<R|kotlin/Any|>()
}
}
@R|OuterAnnotation|(inner = R|/InnerAnnotation.InnerAnnotation|(String(x).R|kotlin/String.plus|(String(x)))) public final class Payload4 : R|kotlin/Any| {
public constructor(): R|Payload4| {
super<R|kotlin/Any|>()
}
}