[FIR2IR] Fix infinite loop between annotation and annotation parameter

When an annotation constructor value parameter is annotated with the
very same annotation, FIR2IR went in an infinite loop when trying
to generate it.
To fix this, the constructor is added to the Fir2IrDeclarationStorage
cache before generating the value parameters.
To accommodate for the missing parameters, the value arguments count
is determined using the FIR.
This commit is contained in:
Kirill Rakhman
2023-05-26 15:08:34 +02:00
committed by Space Team
parent fc75402f65
commit d1ce55cbd2
31 changed files with 634 additions and 48 deletions
@@ -0,0 +1,34 @@
public final annotation class Ann : R|kotlin/Annotation| {
public final val e: R|kotlin/Int|
public get(): R|kotlin/Int|
public constructor(e: R|kotlin/Int|): R|test/Ann|
}
@R|test/MyRequiresOptIn|(a = String(), b = R|test/MyRequiresOptIn.MyLevel.ERROR|) public final annotation class MyRequiresOptIn : R|kotlin/Annotation| {
public final val a: R|kotlin/String| = String()
public get(): R|kotlin/String|
public final val b: R|test/MyRequiresOptIn.MyLevel| = test/MyRequiresOptIn.MyLevel.ERROR
public get(): R|test/MyRequiresOptIn.MyLevel|
public constructor(a: R|kotlin/String| = STUB, b: R|test/MyRequiresOptIn.MyLevel| = STUB): R|test/MyRequiresOptIn|
public final enum class MyLevel : R|kotlin/Enum<test/MyRequiresOptIn.MyLevel>| {
private constructor(): R|test/MyRequiresOptIn.MyLevel|
public final static enum entry WARNING: R|test/MyRequiresOptIn.MyLevel|
public final static enum entry ERROR: R|test/MyRequiresOptIn.MyLevel|
public final static fun values(): R|kotlin/Array<test/MyRequiresOptIn.MyLevel>| {
}
public final static fun valueOf(value: R|kotlin/String|): R|test/MyRequiresOptIn.MyLevel| {
}
public final static val entries: R|kotlin/enums/EnumEntries<test/MyRequiresOptIn.MyLevel>|
public get(): R|kotlin/enums/EnumEntries<test/MyRequiresOptIn.MyLevel>|
}
}