[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
@@ -82,6 +82,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
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")
@@ -88,6 +88,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
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")
@@ -80,6 +80,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
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")
@@ -83,6 +83,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
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")