[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
@@ -71,6 +71,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
}
@Test
@TestMetadata("selfReferentialAnnotation.kt")
public void testSelfReferentialAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@@ -71,6 +71,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
}
@Test
@TestMetadata("selfReferentialAnnotation.kt")
public void testSelfReferentialAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@@ -71,6 +71,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
}
@Test
@TestMetadata("selfReferentialAnnotation.kt")
public void testSelfReferentialAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")
@@ -71,6 +71,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
runTest("compiler/testData/codegen/box/annotations/resolveWithLowPriorityAnnotation.kt");
}
@Test
@TestMetadata("selfReferentialAnnotation.kt")
public void testSelfReferentialAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/selfReferentialAnnotation.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/annotations/annotatedLambda")
@TestDataPath("$PROJECT_ROOT")