[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,17 @@
// NO_CHECK_SOURCE_VS_BINARY
// MUTE_REASON: KT-58935
package test
annotation class Ann(@Ann(1) val e: Int)
@MyRequiresOptIn("", MyRequiresOptIn.MyLevel.ERROR)
public annotation class MyRequiresOptIn(
val a: String = "",
@MyRequiresOptIn("", MyRequiresOptIn.MyLevel.WARNING) val b: MyLevel = MyLevel.ERROR
) {
public enum class MyLevel {
WARNING,
ERROR,
}
}