From 1d5ab8c24f86e061096d58dca0777a197715f64e Mon Sep 17 00:00:00 2001 From: Dmitrii Gridin Date: Wed, 22 Nov 2023 17:46:01 +0100 Subject: [PATCH] [FIR] builder: more tests for annotations ^KT-63042 --- ...RootLazyBodiesCalculatorTestGenerated.java | 108 ++++++++++ ...urceLazyBodiesCalculatorTestGenerated.java | 108 ++++++++++ ...ghtTree2FirConverterTestCaseGenerated.java | 90 ++++++++ .../rawBuilder/declarations/annotation.kt | 10 +- .../declarations/annotation.lazyBodies.txt | 12 +- .../rawBuilder/declarations/annotation.txt | 13 +- .../declarations/annotationOnSuperType.kt | 12 ++ .../annotationOnSuperType.lazyBodies.txt | 26 +++ .../declarations/annotationOnSuperType.txt | 26 +++ .../declarations/annotationOnSuperTypeCall.kt | 12 ++ .../annotationOnSuperTypeCall.lazyBodies.txt | 30 +++ .../annotationOnSuperTypeCall.txt | 30 +++ .../anonymousObjectWithAnnotation.kt | 7 + ...onymousObjectWithAnnotation.lazyBodies.txt | 3 + .../anonymousObjectWithAnnotation.txt | 16 ++ .../classLevelDestructuringWithAnnotation.kt | 6 + ...DestructuringWithAnnotation.lazyBodies.txt | 9 + .../classLevelDestructuringWithAnnotation.txt | 9 + .../constructorWithLocalDeclarations.kt | 17 ++ ...ructorWithLocalDeclarations.lazyBodies.txt | 5 + .../constructorWithLocalDeclarations.txt | 45 ++++ .../declarations/danglingConstrants.kt | 11 + .../danglingConstrants.lazyBodies.txt | 22 ++ .../declarations/danglingConstrants.txt | 24 +++ .../declarations/dataClassWithAnnotations.kt | 9 + .../dataClassWithAnnotations.lazyBodies.txt | 19 ++ .../declarations/dataClassWithAnnotations.txt | 19 ++ .../declarations/delegatedFieldNestedName.kt | 26 +++ .../delegatedFieldNestedName.lazyBodies.txt | 50 +++++ .../declarations/delegatedFieldNestedName.txt | 51 +++++ .../declarations/delegatesWithAnnotations.kt | 24 +++ .../delegatesWithAnnotations.lazyBodies.txt | 10 + .../declarations/delegatesWithAnnotations.txt | 34 +++ .../declarations/enumEntryWithAnnotations.kt | 16 ++ .../enumEntryWithAnnotations.lazyBodies.txt | 17 ++ .../declarations/enumEntryWithAnnotations.txt | 32 +++ .../declarations/fileAnnotations.kt | 4 + .../fileAnnotations.lazyBodies.txt | 5 + .../declarations/fileAnnotations.txt | 5 + .../fileAnnotationsWithoutPackage.kt | 3 + ...leAnnotationsWithoutPackage.lazyBodies.txt | 5 + .../fileAnnotationsWithoutPackage.txt | 5 + .../declarations/initWithLocalDeclarations.kt | 17 ++ .../initWithLocalDeclarations.lazyBodies.txt | 9 + .../initWithLocalDeclarations.txt | 48 +++++ .../declarations/localAnnotations.kt | 167 +++++++++++++++ .../localAnnotations.lazyBodies.txt | 2 + .../declarations/localAnnotations.txt | 202 ++++++++++++++++++ .../declarations/localImplicitType.kt | 17 ++ .../localImplicitType.lazyBodies.txt | 2 + .../declarations/localImplicitType.txt | 43 ++++ .../declarations/multiDeclarations.kt | 16 ++ .../multiDeclarations.lazyBodies.txt | 2 + .../declarations/multiDeclarations.txt | 41 ++++ ...scriptLevelDestructuringWithAnnotation.kts | 7 + ...DestructuringWithAnnotation.lazyBodies.txt | 15 ++ ...scriptLevelDestructuringWithAnnotation.txt | 15 ++ ...tementLevelDestructuringWithAnnotation.kts | 11 + ...DestructuringWithAnnotation.lazyBodies.txt | 15 ++ ...tementLevelDestructuringWithAnnotation.txt | 16 ++ ...ructuringWithAnnotationAsLastStatement.kts | 9 + ...thAnnotationAsLastStatement.lazyBodies.txt | 13 ++ ...ructuringWithAnnotationAsLastStatement.txt | 13 ++ .../declarations/secondaryConstructor.kt | 14 ++ .../secondaryConstructor.lazyBodies.txt | 22 ++ .../declarations/secondaryConstructor.txt | 24 +++ .../topLevelDestructuringWithAnnotation.kt | 4 + ...DestructuringWithAnnotation.lazyBodies.txt | 2 + .../topLevelDestructuringWithAnnotation.txt | 2 + ...FirBuilderLazyBodiesTestCaseGenerated.java | 105 +++++++++ .../RawFirBuilderTestCaseGenerated.java | 105 +++++++++ 71 files changed, 1930 insertions(+), 13 deletions(-) create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.lazyBodies.txt create mode 100644 compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.txt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java index 2f5611a1c6b..e54f2e56238 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirOutOfContentRootLazyBodiesCalculatorTestGenerated.java @@ -51,6 +51,18 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnProperty.kt"); } + @Test + @TestMetadata("annotationOnSuperType.kt") + public void testAnnotationOnSuperType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt"); + } + + @Test + @TestMetadata("annotationOnSuperTypeCall.kt") + public void testAnnotationOnSuperTypeCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt"); + } + @Test @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { @@ -63,6 +75,18 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @Test + @TestMetadata("anonymousObjectWithAnnotation.kt") + public void testAnonymousObjectWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt"); + } + + @Test + @TestMetadata("classLevelDestructuringWithAnnotation.kt") + public void testClassLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt"); + } + @Test @TestMetadata("classWithWrongSuperCall.kt") public void testClassWithWrongSuperCall() throws Exception { @@ -87,6 +111,12 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt"); } + @Test + @TestMetadata("constructorWithLocalDeclarations.kt") + public void testConstructorWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt"); + } + @Test @TestMetadata("contextReceivers.kt") public void testContextReceivers() throws Exception { @@ -105,12 +135,36 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingAnnotationsFileLevel.kt"); } + @Test + @TestMetadata("danglingConstrants.kt") + public void testDanglingConstrants() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt"); + } + + @Test + @TestMetadata("dataClassWithAnnotations.kt") + public void testDataClassWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt"); + } + + @Test + @TestMetadata("delegatedFieldNestedName.kt") + public void testDelegatedFieldNestedName() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt"); + } + @Test @TestMetadata("delegates.kt") public void testDelegates() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.kt"); } + @Test + @TestMetadata("delegatesWithAnnotations.kt") + public void testDelegatesWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt"); + } + @Test @TestMetadata("derivedClass.kt") public void testDerivedClass() throws Exception { @@ -123,6 +177,12 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/emptyAnonymousObject.kt"); } + @Test + @TestMetadata("enumEntryWithAnnotations.kt") + public void testEnumEntryWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt"); + } + @Test @TestMetadata("enums.kt") public void testEnums() throws Exception { @@ -183,6 +243,18 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/F.kt"); } + @Test + @TestMetadata("fileAnnotations.kt") + public void testFileAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt"); + } + + @Test + @TestMetadata("fileAnnotationsWithoutPackage.kt") + public void testFileAnnotationsWithoutPackage() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt"); + } + @Test @TestMetadata("functionTypes.kt") public void testFunctionTypes() throws Exception { @@ -213,6 +285,12 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt"); } + @Test + @TestMetadata("initWithLocalDeclarations.kt") + public void testInitWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt"); + } + @Test @TestMetadata("invalidDestructing.kt") public void testInvalidDestructing() throws Exception { @@ -231,12 +309,30 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/kotlinAnyNonTopLevel.kt"); } + @Test + @TestMetadata("localAnnotations.kt") + public void testLocalAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt"); + } + @Test @TestMetadata("localDeclarationsInEnumEntry.kt") public void testLocalDeclarationsInEnumEntry() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localDeclarationsInEnumEntry.kt"); } + @Test + @TestMetadata("localImplicitType.kt") + public void testLocalImplicitType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt"); + } + + @Test + @TestMetadata("multiDeclarations.kt") + public void testMultiDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt"); + } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { @@ -273,6 +369,12 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt"); } + @Test + @TestMetadata("secondaryConstructor.kt") + public void testSecondaryConstructor() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt"); + } + @Test @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { @@ -303,6 +405,12 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); } + @Test + @TestMetadata("topLevelDestructuringWithAnnotation.kt") + public void testTopLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt"); + } + @Test @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyBodiesCalculatorTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyBodiesCalculatorTestGenerated.java index a1ab489d93d..3a97946bf20 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyBodiesCalculatorTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/FirSourceLazyBodiesCalculatorTestGenerated.java @@ -51,6 +51,18 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnProperty.kt"); } + @Test + @TestMetadata("annotationOnSuperType.kt") + public void testAnnotationOnSuperType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt"); + } + + @Test + @TestMetadata("annotationOnSuperTypeCall.kt") + public void testAnnotationOnSuperTypeCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt"); + } + @Test @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { @@ -63,6 +75,18 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @Test + @TestMetadata("anonymousObjectWithAnnotation.kt") + public void testAnonymousObjectWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt"); + } + + @Test + @TestMetadata("classLevelDestructuringWithAnnotation.kt") + public void testClassLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt"); + } + @Test @TestMetadata("classWithWrongSuperCall.kt") public void testClassWithWrongSuperCall() throws Exception { @@ -87,6 +111,12 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt"); } + @Test + @TestMetadata("constructorWithLocalDeclarations.kt") + public void testConstructorWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt"); + } + @Test @TestMetadata("contextReceivers.kt") public void testContextReceivers() throws Exception { @@ -105,12 +135,36 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingAnnotationsFileLevel.kt"); } + @Test + @TestMetadata("danglingConstrants.kt") + public void testDanglingConstrants() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt"); + } + + @Test + @TestMetadata("dataClassWithAnnotations.kt") + public void testDataClassWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt"); + } + + @Test + @TestMetadata("delegatedFieldNestedName.kt") + public void testDelegatedFieldNestedName() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt"); + } + @Test @TestMetadata("delegates.kt") public void testDelegates() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.kt"); } + @Test + @TestMetadata("delegatesWithAnnotations.kt") + public void testDelegatesWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt"); + } + @Test @TestMetadata("derivedClass.kt") public void testDerivedClass() throws Exception { @@ -123,6 +177,12 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/emptyAnonymousObject.kt"); } + @Test + @TestMetadata("enumEntryWithAnnotations.kt") + public void testEnumEntryWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt"); + } + @Test @TestMetadata("enums.kt") public void testEnums() throws Exception { @@ -183,6 +243,18 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/F.kt"); } + @Test + @TestMetadata("fileAnnotations.kt") + public void testFileAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt"); + } + + @Test + @TestMetadata("fileAnnotationsWithoutPackage.kt") + public void testFileAnnotationsWithoutPackage() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt"); + } + @Test @TestMetadata("functionTypes.kt") public void testFunctionTypes() throws Exception { @@ -213,6 +285,12 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt"); } + @Test + @TestMetadata("initWithLocalDeclarations.kt") + public void testInitWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt"); + } + @Test @TestMetadata("invalidDestructing.kt") public void testInvalidDestructing() throws Exception { @@ -231,12 +309,30 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/kotlinAnyNonTopLevel.kt"); } + @Test + @TestMetadata("localAnnotations.kt") + public void testLocalAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt"); + } + @Test @TestMetadata("localDeclarationsInEnumEntry.kt") public void testLocalDeclarationsInEnumEntry() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localDeclarationsInEnumEntry.kt"); } + @Test + @TestMetadata("localImplicitType.kt") + public void testLocalImplicitType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt"); + } + + @Test + @TestMetadata("multiDeclarations.kt") + public void testMultiDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt"); + } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { @@ -273,6 +369,12 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt"); } + @Test + @TestMetadata("secondaryConstructor.kt") + public void testSecondaryConstructor() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt"); + } + @Test @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { @@ -303,6 +405,12 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); } + @Test + @TestMetadata("topLevelDestructuringWithAnnotation.kt") + public void testTopLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt"); + } + @Test @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { diff --git a/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java b/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java index c93b1477919..71859f91e5a 100644 --- a/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java +++ b/compiler/fir/raw-fir/light-tree2fir/tests-gen/org/jetbrains/kotlin/fir/lightTree/LightTree2FirConverterTestCaseGenerated.java @@ -56,6 +56,16 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnProperty.kt"); } + @TestMetadata("annotationOnSuperType.kt") + public void testAnnotationOnSuperType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt"); + } + + @TestMetadata("annotationOnSuperTypeCall.kt") + public void testAnnotationOnSuperTypeCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt"); + } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); @@ -66,6 +76,16 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @TestMetadata("anonymousObjectWithAnnotation.kt") + public void testAnonymousObjectWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt"); + } + + @TestMetadata("classLevelDestructuringWithAnnotation.kt") + public void testClassLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt"); + } + @TestMetadata("classWithWrongSuperCall.kt") public void testClassWithWrongSuperCall() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); @@ -86,6 +106,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt"); } + @TestMetadata("constructorWithLocalDeclarations.kt") + public void testConstructorWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt"); + } + @TestMetadata("contextReceivers.kt") public void testContextReceivers() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contextReceivers.kt"); @@ -101,11 +126,31 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingAnnotationsFileLevel.kt"); } + @TestMetadata("danglingConstrants.kt") + public void testDanglingConstrants() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt"); + } + + @TestMetadata("dataClassWithAnnotations.kt") + public void testDataClassWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt"); + } + + @TestMetadata("delegatedFieldNestedName.kt") + public void testDelegatedFieldNestedName() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt"); + } + @TestMetadata("delegates.kt") public void testDelegates() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.kt"); } + @TestMetadata("delegatesWithAnnotations.kt") + public void testDelegatesWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt"); + } + @TestMetadata("derivedClass.kt") public void testDerivedClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/derivedClass.kt"); @@ -116,6 +161,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/emptyAnonymousObject.kt"); } + @TestMetadata("enumEntryWithAnnotations.kt") + public void testEnumEntryWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt"); + } + @TestMetadata("enums.kt") public void testEnums() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enums.kt"); @@ -166,6 +216,16 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/F.kt"); } + @TestMetadata("fileAnnotations.kt") + public void testFileAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt"); + } + + @TestMetadata("fileAnnotationsWithoutPackage.kt") + public void testFileAnnotationsWithoutPackage() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt"); + } + @TestMetadata("functionTypes.kt") public void testFunctionTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionTypes.kt"); @@ -191,6 +251,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt"); } + @TestMetadata("initWithLocalDeclarations.kt") + public void testInitWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt"); + } + @TestMetadata("invalidDestructing.kt") public void testInvalidDestructing() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/invalidDestructing.kt"); @@ -206,11 +271,26 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/kotlinAnyNonTopLevel.kt"); } + @TestMetadata("localAnnotations.kt") + public void testLocalAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt"); + } + @TestMetadata("localDeclarationsInEnumEntry.kt") public void testLocalDeclarationsInEnumEntry() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localDeclarationsInEnumEntry.kt"); } + @TestMetadata("localImplicitType.kt") + public void testLocalImplicitType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt"); + } + + @TestMetadata("multiDeclarations.kt") + public void testMultiDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt"); + } + @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/nestedClass.kt"); @@ -241,6 +321,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt"); } + @TestMetadata("secondaryConstructor.kt") + public void testSecondaryConstructor() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt"); + } + @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleClass.kt"); @@ -266,6 +351,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); } + @TestMetadata("topLevelDestructuringWithAnnotation.kt") + public void testTopLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt"); diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt index 9ecbe057897..f2cc39451c7 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.kt @@ -10,6 +10,10 @@ @base class correct(@base val x: Int) { @base constructor(): this(0) + + @base init { + + } } @base enum class My { @@ -17,7 +21,7 @@ @base SECOND } -@base fun foo(@base y: @base Int): Int { +@base fun foo(@base y: @base Int): @base Int { @base fun bar(@base z: @base Int) = z + 1 @base val local = bar(y) return local @@ -36,7 +40,7 @@ AnnotationTarget.TYPE ) @base annotation class derived(val x: Int): base -@derived(1) class correctDerived(@derived(1) val x: Int) { +@derived(1) class correctDerived(@derived(1) val x: @derived(1) Int) { @base constructor(): this(0) } @@ -45,7 +49,7 @@ @derived(1) SECOND } -@derived(1) fun fooDerived(@derived(1) y: @derived(1) Int): Int { +@derived(1) fun fooDerived(@derived(1) y: @derived(1) Int): @derived(1) Int { @derived(1) fun bar(@derived(1) z: @derived(1) Int) = z + 1 @derived(1) val local = bar(y) return local diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.lazyBodies.txt index 369e332293c..9dc58609a7f 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.lazyBodies.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.lazyBodies.txt @@ -17,6 +17,8 @@ FILE: annotation.kt LAZY_this } + @base() init { LAZY_BLOCK } + } @base() public? final? enum class My : R|kotlin/Enum| { private constructor(): R|My| { @@ -35,7 +37,7 @@ FILE: annotation.kt public get(): R|kotlin/enums/EnumEntries| } - @base() public? final? fun foo(@base() y: @base() Int): Int { LAZY_BLOCK } + @base() public? final? fun foo(@base() y: @base() Int): @base() Int { LAZY_BLOCK } @base() public? final? val z: = LAZY_EXPRESSION public? get(): @base() public? final? val x: Map<@base() Int, List<@base() Int>> = LAZY_EXPRESSION @@ -50,12 +52,12 @@ FILE: annotation.kt } @derived(LAZY_EXPRESSION) public? final? class correctDerived : R|kotlin/Any| { - public? constructor(@derived(LAZY_EXPRESSION) x: Int): R|correctDerived| { + public? constructor(@derived(LAZY_EXPRESSION) x: @derived(LAZY_EXPRESSION) Int): R|correctDerived| { LAZY_super } - @derived(LAZY_EXPRESSION) public? final? val x: Int = R|/x| - public? get(): Int + @derived(LAZY_EXPRESSION) public? final? val x: @derived(LAZY_EXPRESSION) Int = R|/x| + public? get(): @derived(LAZY_EXPRESSION) Int @base() public? constructor(): R|correctDerived| { LAZY_this @@ -79,7 +81,7 @@ FILE: annotation.kt public get(): R|kotlin/enums/EnumEntries| } - @derived(LAZY_EXPRESSION) public? final? fun fooDerived(@derived(LAZY_EXPRESSION) y: @derived(LAZY_EXPRESSION) Int): Int { LAZY_BLOCK } + @derived(LAZY_EXPRESSION) public? final? fun fooDerived(@derived(LAZY_EXPRESSION) y: @derived(LAZY_EXPRESSION) Int): @derived(LAZY_EXPRESSION) Int { LAZY_BLOCK } @derived(LAZY_EXPRESSION) public? final? val zDerived: = LAZY_EXPRESSION public? get(): @derived(LAZY_EXPRESSION) public? final? val xDerived: Map<@derived(LAZY_EXPRESSION) Int, List<@derived(LAZY_EXPRESSION) Int>> = LAZY_EXPRESSION diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.txt index 2efc6d36123..b4aa1286b05 100644 --- a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.txt +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotation.txt @@ -17,6 +17,9 @@ FILE: annotation.kt this(IntegerLiteral(0)) } + @base() init { + } + } @base() public? final? enum class My : R|kotlin/Enum| { private [ContainingClassKey=My] constructor(): R|My| { @@ -47,7 +50,7 @@ FILE: annotation.kt public get(): R|kotlin/enums/EnumEntries| } - @base() public? final? fun foo(@base() y: @base() Int): Int { + @base() public? final? fun foo(@base() y: @base() Int): @base() Int { @base() local final? fun bar(@base() z: @base() Int): { ^bar z#.plus#(IntegerLiteral(1)) } @@ -69,12 +72,12 @@ FILE: annotation.kt } @derived(IntegerLiteral(1)) public? final? class correctDerived : R|kotlin/Any| { - public? [ContainingClassKey=correctDerived] constructor([CorrespondingProperty=/correctDerived.x] @derived(IntegerLiteral(1)) x: Int): R|correctDerived| { + public? [ContainingClassKey=correctDerived] constructor([CorrespondingProperty=/correctDerived.x] @derived(IntegerLiteral(1)) x: @derived(IntegerLiteral(1)) Int): R|correctDerived| { super() } - @derived(IntegerLiteral(1)) public? final? [IsFromPrimaryConstructor=true] val x: Int = R|/x| - public? [ContainingClassKey=correctDerived] get(): Int + @derived(IntegerLiteral(1)) public? final? [IsFromPrimaryConstructor=true] val x: @derived(IntegerLiteral(1)) Int = R|/x| + public? [ContainingClassKey=correctDerived] get(): @derived(IntegerLiteral(1)) Int @base() public? [ContainingClassKey=correctDerived] constructor(): R|correctDerived| { this(IntegerLiteral(0)) @@ -110,7 +113,7 @@ FILE: annotation.kt public get(): R|kotlin/enums/EnumEntries| } - @derived(IntegerLiteral(1)) public? final? fun fooDerived(@derived(IntegerLiteral(1)) y: @derived(IntegerLiteral(1)) Int): Int { + @derived(IntegerLiteral(1)) public? final? fun fooDerived(@derived(IntegerLiteral(1)) y: @derived(IntegerLiteral(1)) Int): @derived(IntegerLiteral(1)) Int { @derived(IntegerLiteral(1)) local final? fun bar(@derived(IntegerLiteral(1)) z: @derived(IntegerLiteral(1)) Int): { ^bar z#.plus#(IntegerLiteral(1)) } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt new file mode 100644 index 00000000000..90c548132ca --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt @@ -0,0 +1,12 @@ +package util + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val position: String) + +const val prop = "str" + +interface I + +class MyClassWithoutConstructor : @Anno("MyClassWithoutConstructor super type ref $prop") List<@Anno("MyClassWithoutConstructor nested super type ref $prop") List<@Anno("MyClassWithoutConstructor nested nested super type ref $prop") I>> + +class MyClassWithConstructor() : @Anno("MyClassWithConstructor super type ref $prop") List<@Anno("MyClassWithConstructor nested super type ref $prop") List<@Anno("MyClassWithConstructor nested nested super type ref $prop") I>> \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.lazyBodies.txt new file mode 100644 index 00000000000..f68b06bcdf9 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.lazyBodies.txt @@ -0,0 +1,26 @@ +FILE: annotationOnSuperType.kt + @Target(LAZY_EXPRESSION) public? final? annotation class Anno : R|kotlin/Annotation| { + public? constructor(position: String): R|util/Anno| { + LAZY_super + } + + public? final? val position: String = R|/position| + public? get(): String + + } + public? final? const val prop: = LAZY_EXPRESSION + public? get(): + public? final? interface I : R|kotlin/Any| { + } + public? final? class MyClassWithoutConstructor : @Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) I>> { + public? constructor(): R|util/MyClassWithoutConstructor| { + LAZY_super<> + } + + } + public? final? class MyClassWithConstructor : @Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) I>> { + public? constructor(): R|util/MyClassWithConstructor| { + LAZY_super<> + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.txt new file mode 100644 index 00000000000..6a6159bd7a1 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.txt @@ -0,0 +1,26 @@ +FILE: annotationOnSuperType.kt + @Target(AnnotationTarget#.TYPE#) public? final? annotation class Anno : R|kotlin/Annotation| { + public? [ContainingClassKey=Anno] constructor([CorrespondingProperty=util/Anno.position] position: String): R|util/Anno| { + super() + } + + public? final? [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ContainingClassKey=Anno] get(): String + + } + public? final? const val prop: = String(str) + public? get(): + public? final? interface I : R|kotlin/Any| { + } + public? final? class MyClassWithoutConstructor : @Anno((String(MyClassWithoutConstructor super type ref ), prop#)) List<@Anno((String(MyClassWithoutConstructor nested super type ref ), prop#)) List<@Anno((String(MyClassWithoutConstructor nested nested super type ref ), prop#)) I>> { + public? [ContainingClassKey=MyClassWithoutConstructor] constructor(): R|util/MyClassWithoutConstructor| { + super<>() + } + + } + public? final? class MyClassWithConstructor : @Anno((String(MyClassWithConstructor super type ref ), prop#)) List<@Anno((String(MyClassWithConstructor nested super type ref ), prop#)) List<@Anno((String(MyClassWithConstructor nested nested super type ref ), prop#)) I>> { + public? [ContainingClassKey=MyClassWithConstructor] constructor(): R|util/MyClassWithConstructor| { + super<>() + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt new file mode 100644 index 00000000000..10ed8e16fbb --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt @@ -0,0 +1,12 @@ +package util + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val position: String) + +const val prop = "str" + +abstract class AbstractClass + +class MyClassWithoutConstructor : @Anno("MyClassWithoutConstructor super type call $prop") AbstractClass<@Anno("MyClassWithoutConstructor nested super type ref $prop") List<@Anno("MyClassWithoutConstructor nested nested super type ref $prop") Int>>() + +class MyClassWithConstructor() : @Anno("MyClassWithConstructor super type call $prop") AbstractClass<@Anno("MyClassWithConstructor nested super type ref $prop") List<@Anno("MyClassWithConstructor nested nested super type ref $prop") Int>>() \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.lazyBodies.txt new file mode 100644 index 00000000000..3b211a30942 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.lazyBodies.txt @@ -0,0 +1,30 @@ +FILE: annotationOnSuperTypeCall.kt + @Target(LAZY_EXPRESSION) public? final? annotation class Anno : R|kotlin/Annotation| { + public? constructor(position: String): R|util/Anno| { + LAZY_super + } + + public? final? val position: String = R|/position| + public? get(): String + + } + public? final? const val prop: = LAZY_EXPRESSION + public? get(): + public? abstract class AbstractClass : R|kotlin/Any| { + public? constructor(): R|util/AbstractClass| { + LAZY_super + } + + } + public? final? class MyClassWithoutConstructor : @Anno(LAZY_EXPRESSION) AbstractClass<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) Int>> { + public? constructor(): R|util/MyClassWithoutConstructor| { + LAZY_super<@Anno(LAZY_EXPRESSION) AbstractClass<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) Int>>> + } + + } + public? final? class MyClassWithConstructor : @Anno(LAZY_EXPRESSION) AbstractClass<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) Int>> { + public? constructor(): R|util/MyClassWithConstructor| { + LAZY_super<@Anno(LAZY_EXPRESSION) AbstractClass<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) Int>>> + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.txt new file mode 100644 index 00000000000..66f7c9d4753 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.txt @@ -0,0 +1,30 @@ +FILE: annotationOnSuperTypeCall.kt + @Target(AnnotationTarget#.TYPE#) public? final? annotation class Anno : R|kotlin/Annotation| { + public? [ContainingClassKey=Anno] constructor([CorrespondingProperty=util/Anno.position] position: String): R|util/Anno| { + super() + } + + public? final? [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ContainingClassKey=Anno] get(): String + + } + public? final? const val prop: = String(str) + public? get(): + public? abstract class AbstractClass : R|kotlin/Any| { + public? [ContainingClassKey=AbstractClass] constructor(): R|util/AbstractClass| { + super() + } + + } + public? final? class MyClassWithoutConstructor : @Anno((String(MyClassWithoutConstructor super type call ), prop#)) AbstractClass<@Anno((String(MyClassWithoutConstructor nested super type ref ), prop#)) List<@Anno((String(MyClassWithoutConstructor nested nested super type ref ), prop#)) Int>> { + public? [ContainingClassKey=MyClassWithoutConstructor] constructor(): R|util/MyClassWithoutConstructor| { + super<@Anno((String(MyClassWithoutConstructor super type call ), prop#)) AbstractClass<@Anno((String(MyClassWithoutConstructor nested super type ref ), prop#)) List<@Anno((String(MyClassWithoutConstructor nested nested super type ref ), prop#)) Int>>>() + } + + } + public? final? class MyClassWithConstructor : @Anno((String(MyClassWithConstructor super type call ), prop#)) AbstractClass<@Anno((String(MyClassWithConstructor nested super type ref ), prop#)) List<@Anno((String(MyClassWithConstructor nested nested super type ref ), prop#)) Int>> { + public? [ContainingClassKey=MyClassWithConstructor] constructor(): R|util/MyClassWithConstructor| { + super<@Anno((String(MyClassWithConstructor super type call ), prop#)) AbstractClass<@Anno((String(MyClassWithConstructor nested super type ref ), prop#)) List<@Anno((String(MyClassWithConstructor nested nested super type ref ), prop#)) Int>>>() + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt new file mode 100644 index 00000000000..4e4edb469cc --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt @@ -0,0 +1,7 @@ +val prop = @Anno("object annotation") object : @SuperType("super type") List<@SuperType("nested super type") Collection<@SuperType("nested nested super type")Int>>() { + @Anno("init") init { + @Expression("expr") foo().let { it: @Anno("lambda param type") Int -> + + } + } +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.lazyBodies.txt new file mode 100644 index 00000000000..78ef15d4c8e --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.lazyBodies.txt @@ -0,0 +1,3 @@ +FILE: anonymousObjectWithAnnotation.kt + public? final? val prop: = LAZY_EXPRESSION + public? get(): diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.txt new file mode 100644 index 00000000000..951a96ea1fd --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.txt @@ -0,0 +1,16 @@ +FILE: anonymousObjectWithAnnotation.kt + public? final? val prop: = @Anno(String(object annotation)) object : @SuperType(String(super type)) List<@SuperType(String(nested super type)) Collection<@SuperType(String(nested nested super type)) Int>> { + private [ContainingClassKey=] constructor(): R|| { + super<@SuperType(String(super type)) List<@SuperType(String(nested super type)) Collection<@SuperType(String(nested nested super type)) Int>>>() + } + + @Anno(String(init)) init { + @Expression(String(expr)) foo#().let#( = let@fun .(it: @Anno(String(lambda param type)) Int): { + ^@let Unit + } + ) + } + + } + + public? get(): diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt new file mode 100644 index 00000000000..771c27259ec --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt @@ -0,0 +1,6 @@ +package util + +class Foo { + @Destructuring("destr $prop") + val (@LeftAnno("a $prop") a, @RightAnno("b $prop") b) = Pair(0, 1) +} \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.lazyBodies.txt new file mode 100644 index 00000000000..59e365fad49 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.lazyBodies.txt @@ -0,0 +1,9 @@ +FILE: classLevelDestructuringWithAnnotation.kt + public? final? class Foo : R|kotlin/Any| { + public? constructor(): R|util/Foo| { + LAZY_super + } + + + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.txt new file mode 100644 index 00000000000..4cfa5fadcbd --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.txt @@ -0,0 +1,9 @@ +FILE: classLevelDestructuringWithAnnotation.kt + public? final? class Foo : R|kotlin/Any| { + public? [ContainingClassKey=Foo] constructor(): R|util/Foo| { + super() + } + + + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt new file mode 100644 index 00000000000..598bd138676 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt @@ -0,0 +1,17 @@ +package util + +class A { + constructor() { + class OuterIntoLocal { + fun doo() = foo() + fun foo() = bar() + fun baz() = foo() + } + + class LocalIntoLocal { + fun foo() = bar() + fun bar(): @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null + fun foo2() = bar() + } + } +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.lazyBodies.txt new file mode 100644 index 00000000000..14790d909d4 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.lazyBodies.txt @@ -0,0 +1,5 @@ +FILE: constructorWithLocalDeclarations.kt + public? final? class A : R|kotlin/Any| { + public? constructor(): R|util/A| { LAZY_BLOCK } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.txt new file mode 100644 index 00000000000..baeb1abc0f3 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.txt @@ -0,0 +1,45 @@ +FILE: constructorWithLocalDeclarations.kt + public? final? class A : R|kotlin/Any| { + public? [ContainingClassKey=A] constructor(): R|util/A| { + super() + local final? class OuterIntoLocal : R|kotlin/Any| { + public? [ContainingClassKey=OuterIntoLocal] constructor(): R|/OuterIntoLocal| { + super() + } + + public? final? fun doo(): { + ^doo foo#() + } + + public? final? fun foo(): { + ^foo bar#() + } + + public? final? fun baz(): { + ^baz foo#() + } + + } + + local final? class LocalIntoLocal : R|kotlin/Any| { + public? [ContainingClassKey=LocalIntoLocal] constructor(): R|/LocalIntoLocal| { + super() + } + + public? final? fun foo(): { + ^foo bar#() + } + + public? final? fun bar(): @Anno((String(bar ), prop#)) List<@Anno((String(nested bar ), prop#)) Collection<@Anno((String(nested nested bar ), prop#)) Int>>? { + ^bar Null(null) + } + + public? final? fun foo2(): { + ^foo2 bar#() + } + + } + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt new file mode 100644 index 00000000000..7b915a4a4d2 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt @@ -0,0 +1,11 @@ +fun function(): Int where T : @Anno("function contraint") List<@Anno("nested function contraint") Collection<@Anno("nested nested function contraint") String>> {} +val property: String where T : @Anno("property contraint") List<@Anno("nested property contraint") Collection<@Anno("nested nested property contraint") String>> = + "0" + +class TopLevelClass where T : @Anno("class contraint") List<@Anno("nested class contraint") Collection<@Anno("nested nested class contraint") String>> { + fun memberFunction(): Int where T : @Anno("member function contraint") List<@Anno("nested member function contraint") Collection<@Anno("nested nested member function contraint") String>> {} + val memberProperty: String where T : @Anno("member property contraint") List<@Anno("nested member property contraint") Collection<@Anno("nested nested member property contraint") String>> = + "0" + + class NestedClass where T : @Anno("class contraint") List<@Anno("nested class contraint") Collection<@Anno("nested nested class contraint") String>> +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.lazyBodies.txt new file mode 100644 index 00000000000..86bff71025c --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.lazyBodies.txt @@ -0,0 +1,22 @@ +FILE: danglingConstrants.kt + public? final? fun function(): Int { LAZY_BLOCK } + public? final? val property: String = LAZY_EXPRESSION + public? get(): String + public? final? class TopLevelClass : R|kotlin/Any| { + public? constructor(): R|TopLevelClass| { + LAZY_super + } + + public? final? fun memberFunction(): Int { LAZY_BLOCK } + + public? final? val memberProperty: String = LAZY_EXPRESSION + public? get(): String + + public? final? class NestedClass : R|kotlin/Any| { + public? constructor(): R|TopLevelClass.NestedClass| { + LAZY_super + } + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.txt new file mode 100644 index 00000000000..07dca1d555d --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.txt @@ -0,0 +1,24 @@ +FILE: danglingConstrants.kt + public? final? fun function(): Int { + } + public? final? val property: String = String(0) + public? get(): String + public? final? class TopLevelClass : R|kotlin/Any| { + public? [ContainingClassKey=TopLevelClass] constructor(): R|TopLevelClass| { + super() + } + + public? final? fun memberFunction(): Int { + } + + public? final? val memberProperty: String = String(0) + public? [ContainingClassKey=TopLevelClass] get(): String + + public? final? class NestedClass : R|kotlin/Any| { + public? [ContainingClassKey=NestedClass] constructor(): R|TopLevelClass.NestedClass| { + super() + } + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt new file mode 100644 index 00000000000..6d65ec7fe69 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt @@ -0,0 +1,9 @@ +@Anno("Derived $x") +data class Derived @Anno("Derived constructor $x") constructor( + @Anno("b $x") + @get:Anno("get: b $x") + @param:Anno("param: b $x") + @property:Anno("property: b $x") + val b: @Anno("Derived b parameter type $x") B<@Anno("nested Derived b parameter type $x") BNested<@Anno("nested nested Derived b parameter type $x") BNestedNested>>, + val c: @Anno("Derived c parameter type $x") C<@Anno("nested Derived c parameter type $x") CNested<@Anno("nested nested Derived c parameter type $x") CNestedNested>>, +) : @Anno("Base super type call $x") Base<@Anno("nested super type call $x") Nested<@Anno("nested nested super type call $x") NestedNested>>() diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.lazyBodies.txt new file mode 100644 index 00000000000..67b508d9271 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.lazyBodies.txt @@ -0,0 +1,19 @@ +FILE: dataClassWithAnnotations.kt + @Anno(LAZY_EXPRESSION) public? final? data class Derived : @Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Nested<@Anno(LAZY_EXPRESSION) NestedNested>> { + @Anno(LAZY_EXPRESSION) public? constructor(@Anno(LAZY_EXPRESSION) @CONSTRUCTOR_PARAMETER:Anno(LAZY_EXPRESSION) b: @Anno(LAZY_EXPRESSION) B<@Anno(LAZY_EXPRESSION) BNested<@Anno(LAZY_EXPRESSION) BNestedNested>>, c: @Anno(LAZY_EXPRESSION) C<@Anno(LAZY_EXPRESSION) CNested<@Anno(LAZY_EXPRESSION) CNestedNested>>): R|Derived| { + LAZY_super<@Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Nested<@Anno(LAZY_EXPRESSION) NestedNested>>> + } + + @Anno(LAZY_EXPRESSION) @PROPERTY:Anno(LAZY_EXPRESSION) public? final? val b: @Anno(LAZY_EXPRESSION) B<@Anno(LAZY_EXPRESSION) BNested<@Anno(LAZY_EXPRESSION) BNestedNested>> = R|/b| + @PROPERTY_GETTER:Anno(LAZY_EXPRESSION) public? get(): @Anno(LAZY_EXPRESSION) B<@Anno(LAZY_EXPRESSION) BNested<@Anno(LAZY_EXPRESSION) BNestedNested>> + + public? final? val c: @Anno(LAZY_EXPRESSION) C<@Anno(LAZY_EXPRESSION) CNested<@Anno(LAZY_EXPRESSION) CNestedNested>> = R|/c| + public? get(): @Anno(LAZY_EXPRESSION) C<@Anno(LAZY_EXPRESSION) CNested<@Anno(LAZY_EXPRESSION) CNestedNested>> + + public? final operator fun component1(): @Anno(LAZY_EXPRESSION) B<@Anno(LAZY_EXPRESSION) BNested<@Anno(LAZY_EXPRESSION) BNestedNested>> + + public? final operator fun component2(): @Anno(LAZY_EXPRESSION) C<@Anno(LAZY_EXPRESSION) CNested<@Anno(LAZY_EXPRESSION) CNestedNested>> + + public final fun copy(@Anno(LAZY_EXPRESSION) @Anno(LAZY_EXPRESSION) b: @Anno(LAZY_EXPRESSION) B<@Anno(LAZY_EXPRESSION) BNested<@Anno(LAZY_EXPRESSION) BNestedNested>> = this@R|/Derived|.R|/Derived.b|, c: @Anno(LAZY_EXPRESSION) C<@Anno(LAZY_EXPRESSION) CNested<@Anno(LAZY_EXPRESSION) CNestedNested>> = this@R|/Derived|.R|/Derived.c|): R|Derived| + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.txt new file mode 100644 index 00000000000..23d63732cb8 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.txt @@ -0,0 +1,19 @@ +FILE: dataClassWithAnnotations.kt + @Anno((String(Derived ), x#)) public? final? data class Derived : @Anno((String(Base super type call ), x#)) Base<@Anno((String(nested super type call ), x#)) Nested<@Anno((String(nested nested super type call ), x#)) NestedNested>> { + @Anno((String(Derived constructor ), x#)) public? [ContainingClassKey=Derived] constructor([CorrespondingProperty=/Derived.b] @Anno((String(b ), x#)) @CONSTRUCTOR_PARAMETER:Anno((String(param: b ), x#)) b: @Anno((String(Derived b parameter type ), x#)) B<@Anno((String(nested Derived b parameter type ), x#)) BNested<@Anno((String(nested nested Derived b parameter type ), x#)) BNestedNested>>, [CorrespondingProperty=/Derived.c] c: @Anno((String(Derived c parameter type ), x#)) C<@Anno((String(nested Derived c parameter type ), x#)) CNested<@Anno((String(nested nested Derived c parameter type ), x#)) CNestedNested>>): R|Derived| { + super<@Anno((String(Base super type call ), x#)) Base<@Anno((String(nested super type call ), x#)) Nested<@Anno((String(nested nested super type call ), x#)) NestedNested>>>() + } + + @Anno((String(b ), x#)) @PROPERTY:Anno((String(property: b ), x#)) public? final? [ComponentFunctionSymbolKey=/Derived.component1, IsFromPrimaryConstructor=true] val b: @Anno((String(Derived b parameter type ), x#)) B<@Anno((String(nested Derived b parameter type ), x#)) BNested<@Anno((String(nested nested Derived b parameter type ), x#)) BNestedNested>> = R|/b| + @PROPERTY_GETTER:Anno((String(get: b ), x#)) public? [ContainingClassKey=Derived] get(): @Anno((String(Derived b parameter type ), x#)) B<@Anno((String(nested Derived b parameter type ), x#)) BNested<@Anno((String(nested nested Derived b parameter type ), x#)) BNestedNested>> + + public? final? [ComponentFunctionSymbolKey=/Derived.component2, IsFromPrimaryConstructor=true] val c: @Anno((String(Derived c parameter type ), x#)) C<@Anno((String(nested Derived c parameter type ), x#)) CNested<@Anno((String(nested nested Derived c parameter type ), x#)) CNestedNested>> = R|/c| + public? [ContainingClassKey=Derived] get(): @Anno((String(Derived c parameter type ), x#)) C<@Anno((String(nested Derived c parameter type ), x#)) CNested<@Anno((String(nested nested Derived c parameter type ), x#)) CNestedNested>> + + public? final operator fun component1(): @Anno((String(Derived b parameter type ), x#)) B<@Anno((String(nested Derived b parameter type ), x#)) BNested<@Anno((String(nested nested Derived b parameter type ), x#)) BNestedNested>> + + public? final operator fun component2(): @Anno((String(Derived c parameter type ), x#)) C<@Anno((String(nested Derived c parameter type ), x#)) CNested<@Anno((String(nested nested Derived c parameter type ), x#)) CNestedNested>> + + public final fun copy(@Anno((String(b ), x#)) @Anno((String(param: b ), x#)) b: @Anno((String(Derived b parameter type ), x#)) B<@Anno((String(nested Derived b parameter type ), x#)) BNested<@Anno((String(nested nested Derived b parameter type ), x#)) BNestedNested>> = this@R|/Derived|.R|/Derived.b|, c: @Anno((String(Derived c parameter type ), x#)) C<@Anno((String(nested Derived c parameter type ), x#)) CNested<@Anno((String(nested nested Derived c parameter type ), x#)) CNestedNested>> = this@R|/Derived|.R|/Derived.c|): R|Derived| + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt new file mode 100644 index 00000000000..2ca13438609 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt @@ -0,0 +1,26 @@ +package second + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val i: Int) + +interface Base { + fun foo() {} +} + +interface Second { + +} + +const val outer = 0 +const val inner = "" + +class MyClass : + @Anno(0 + outer) Base<@Anno(1 + outer) Base<@Anno(2 + outer) Int>> by Companion, + @Anno(4 + outer) Second<@Anno(5 + outer) String> by NestedObject { + companion object : @Anno(6 + inner) Base<@Anno(7 + inner) Base<@Anno(8 + inner) Int>> { + const val outer = "" + const val inner = 0 + } + + object NestedObject : @Anno(9 + inner) Second<@Anno(10 + inner) String> +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.lazyBodies.txt new file mode 100644 index 00000000000..99e42d2adb2 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.lazyBodies.txt @@ -0,0 +1,50 @@ +FILE: delegatedFieldNestedName.kt + @Target(LAZY_EXPRESSION) public? final? annotation class Anno : R|kotlin/Annotation| { + public? constructor(i: Int): R|second/Anno| { + LAZY_super + } + + public? final? val i: Int = R|/i| + public? get(): Int + + } + public? final? interface Base : R|kotlin/Any| { + public? final? fun foo(): R|kotlin/Unit| { LAZY_BLOCK } + + } + public? final? interface Second : R|kotlin/Any| { + } + public? final? const val outer: = LAZY_EXPRESSION + public? get(): + public? final? const val inner: = LAZY_EXPRESSION + public? get(): + public? final? class MyClass : @Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Int>>, @Anno(LAZY_EXPRESSION) Second<@Anno(LAZY_EXPRESSION) String> { + public? constructor(): R|second/MyClass| { + LAZY_super<> + } + + private final field $$delegate_0: @Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Int>> = LAZY_EXPRESSION + + private final field $$delegate_1: @Anno(LAZY_EXPRESSION) Second<@Anno(LAZY_EXPRESSION) String> = LAZY_EXPRESSION + + public? final? companion object Companion : @Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Base<@Anno(LAZY_EXPRESSION) Int>> { + private constructor(): R|second/MyClass.Companion| { + LAZY_super<> + } + + public? final? const val outer: = LAZY_EXPRESSION + public? get(): + + public? final? const val inner: = LAZY_EXPRESSION + public? get(): + + } + + public? final? object NestedObject : @Anno(LAZY_EXPRESSION) Second<@Anno(LAZY_EXPRESSION) String> { + private constructor(): R|second/MyClass.NestedObject| { + LAZY_super<> + } + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.txt new file mode 100644 index 00000000000..e0c3115b76d --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.txt @@ -0,0 +1,51 @@ +FILE: delegatedFieldNestedName.kt + @Target(AnnotationTarget#.TYPE#) public? final? annotation class Anno : R|kotlin/Annotation| { + public? [ContainingClassKey=Anno] constructor([CorrespondingProperty=second/Anno.i] i: Int): R|second/Anno| { + super() + } + + public? final? [IsFromPrimaryConstructor=true] val i: Int = R|/i| + public? [ContainingClassKey=Anno] get(): Int + + } + public? final? interface Base : R|kotlin/Any| { + public? final? fun foo(): R|kotlin/Unit| { + } + + } + public? final? interface Second : R|kotlin/Any| { + } + public? final? const val outer: = IntegerLiteral(0) + public? get(): + public? final? const val inner: = String() + public? get(): + public? final? [DelegateFieldsMapKey={0=FirFieldSymbol second/MyClass.$$delegate_0, 1=FirFieldSymbol second/MyClass.$$delegate_1}] class MyClass : @Anno(IntegerLiteral(0).plus#(outer#)) Base<@Anno(IntegerLiteral(1).plus#(outer#)) Base<@Anno(IntegerLiteral(2).plus#(outer#)) Int>>, @Anno(IntegerLiteral(4).plus#(outer#)) Second<@Anno(IntegerLiteral(5).plus#(outer#)) String> { + public? [ContainingClassKey=MyClass] constructor(): R|second/MyClass| { + super<>() + } + + private final field $$delegate_0: @Anno(IntegerLiteral(0).plus#(outer#)) Base<@Anno(IntegerLiteral(1).plus#(outer#)) Base<@Anno(IntegerLiteral(2).plus#(outer#)) Int>> = Companion# + + private final field $$delegate_1: @Anno(IntegerLiteral(4).plus#(outer#)) Second<@Anno(IntegerLiteral(5).plus#(outer#)) String> = NestedObject# + + public? final? companion object Companion : @Anno(IntegerLiteral(6).plus#(inner#)) Base<@Anno(IntegerLiteral(7).plus#(inner#)) Base<@Anno(IntegerLiteral(8).plus#(inner#)) Int>> { + private [ContainingClassKey=Companion] constructor(): R|second/MyClass.Companion| { + super<>() + } + + public? final? const val outer: = String() + public? [ContainingClassKey=Companion] get(): + + public? final? const val inner: = IntegerLiteral(0) + public? [ContainingClassKey=Companion] get(): + + } + + public? final? object NestedObject : @Anno(IntegerLiteral(9).plus#(inner#)) Second<@Anno(IntegerLiteral(10).plus#(inner#)) String> { + private [ContainingClassKey=NestedObject] constructor(): R|second/MyClass.NestedObject| { + super<>() + } + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt new file mode 100644 index 00000000000..77d1ee3ab07 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt @@ -0,0 +1,24 @@ +@Anno("x annotation $x") +val x: Int by lazy { 1 + 2 } + +@Anno("delegate annotation $x") +@delegate:Anno("delegate: delegate annotation $x") +val delegate = object: ReadWriteProperty<@Anno("ReadWriteProperty first type argument $x") Any?, @Anno("ReadWriteProperty second type argument $x") Int> { + @Anno("getValue $x") + override fun getValue(thisRef: Any?, property: KProperty<*>): @Anno("getValue return type $x") Int = 1 + + @Anno("setValue $x") + override fun setValue(thisRef: Any?, property: KProperty<*>, value: @Anno("setValue value parameter type $x") Int) {} +} + +@Anno("value annotation $x") +@delegate:Anno("delegate: value annotation $x") +@get:Anno("get: value annotation $x") +val value by delegate + +@Anno("variable annotation $x") +@delegate:Anno("delegate: value annotation $x") +@get:Anno("get: value annotation $x") +@set:Anno("set: value annotation $x") +@setparam:Anno("setparam: value annotation $x") +var variable by delegate diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.lazyBodies.txt new file mode 100644 index 00000000000..79d7b5d9f57 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.lazyBodies.txt @@ -0,0 +1,10 @@ +FILE: delegatesWithAnnotations.kt + @Anno(LAZY_EXPRESSION) public? final? val x: Intby LAZY_EXPRESSION + public? get(): { LAZY_BLOCK } + @Anno(LAZY_EXPRESSION) field:@PROPERTY_DELEGATE_FIELD:Anno(LAZY_EXPRESSION) public? final? val delegate: = LAZY_EXPRESSION + public? get(): + @Anno(LAZY_EXPRESSION) field:@PROPERTY_DELEGATE_FIELD:Anno(LAZY_EXPRESSION) public? final? val value: by LAZY_EXPRESSION + @PROPERTY_GETTER:Anno(LAZY_EXPRESSION) public? get(): { LAZY_BLOCK } + @Anno(LAZY_EXPRESSION) field:@PROPERTY_DELEGATE_FIELD:Anno(LAZY_EXPRESSION) public? final? var variable: by LAZY_EXPRESSION + @PROPERTY_GETTER:Anno(LAZY_EXPRESSION) public? get(): { LAZY_BLOCK } + @PROPERTY_SETTER:Anno(LAZY_EXPRESSION) public? set(@SETTER_PARAMETER:Anno(LAZY_EXPRESSION) : ): R|kotlin/Unit| { LAZY_BLOCK } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.txt new file mode 100644 index 00000000000..5593d6e3c9f --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.txt @@ -0,0 +1,34 @@ +FILE: delegatesWithAnnotations.kt + @Anno((String(x annotation ), x#)) public? final? val x: Intby lazy#( = lazy@fun .(): { + IntegerLiteral(1).plus#(IntegerLiteral(2)) + } + ) + public? get(): { + ^ D|/x|.getValue#(Null(null), ::R|/x|) + } + @Anno((String(delegate annotation ), x#)) field:@PROPERTY_DELEGATE_FIELD:Anno((String(delegate: delegate annotation ), x#)) public? final? val delegate: = object : ReadWriteProperty<@Anno((String(ReadWriteProperty first type argument ), x#)) Any?, @Anno((String(ReadWriteProperty second type argument ), x#)) Int> { + private [ContainingClassKey=] constructor(): R|| { + super<>() + } + + @Anno((String(getValue ), x#)) public? open? override fun getValue(thisRef: Any?, property: KProperty<*>): @Anno((String(getValue return type ), x#)) Int { + ^getValue IntegerLiteral(1) + } + + @Anno((String(setValue ), x#)) public? open? override fun setValue(thisRef: Any?, property: KProperty<*>, value: @Anno((String(setValue value parameter type ), x#)) Int): R|kotlin/Unit| { + } + + } + + public? get(): + @Anno((String(value annotation ), x#)) field:@PROPERTY_DELEGATE_FIELD:Anno((String(delegate: value annotation ), x#)) public? final? val value: by delegate# + @PROPERTY_GETTER:Anno((String(get: value annotation ), x#)) public? get(): { + ^ D|/value|.getValue#(Null(null), ::R|/value|) + } + @Anno((String(variable annotation ), x#)) field:@PROPERTY_DELEGATE_FIELD:Anno((String(delegate: value annotation ), x#)) public? final? var variable: by delegate# + @PROPERTY_GETTER:Anno((String(get: value annotation ), x#)) public? get(): { + ^ D|/variable|.getValue#(Null(null), ::R|/variable|) + } + @PROPERTY_SETTER:Anno((String(set: value annotation ), x#)) public? set(@SETTER_PARAMETER:Anno((String(setparam: value annotation ), x#)) : ): R|kotlin/Unit| { + ^ D|/variable|.setValue#(Null(null), ::R|/variable|, R|/variable|) + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt new file mode 100644 index 00000000000..f625960467b --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt @@ -0,0 +1,16 @@ +@EnumAnnotation("enum") +enum class MyEnumClass { + @Anno("implicit") @property:Anno("explicit") ENUM_ENTRY { + @Anno("init annotations") init { + @Expression("expression annotation") foo() + } + + @FunAnno("fun") + fun foo(): @Anno("return type") A<@Anno("nested return type") B> { + + } + + @ErrorPlace("destructuring declaration") + val (@A("a") a, @B("b") b) = 1 to 2 + } +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.lazyBodies.txt new file mode 100644 index 00000000000..f829e4f5f5f --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.lazyBodies.txt @@ -0,0 +1,17 @@ +FILE: enumEntryWithAnnotations.kt + @EnumAnnotation(LAZY_EXPRESSION) public? final? enum class MyEnumClass : R|kotlin/Enum| { + private constructor(): R|MyEnumClass| { + LAZY_super|> + } + + @Anno(LAZY_EXPRESSION) @PROPERTY:Anno(LAZY_EXPRESSION) public final static enum entry ENUM_ENTRY: R|MyEnumClass| = LAZY_EXPRESSION + public final static fun values(): R|kotlin/Array| { + } + + public final static fun valueOf(value: R|kotlin/String|): R|MyEnumClass| { + } + + public final static val entries: R|kotlin/enums/EnumEntries| + public get(): R|kotlin/enums/EnumEntries| + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.txt new file mode 100644 index 00000000000..ae33a936c32 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.txt @@ -0,0 +1,32 @@ +FILE: enumEntryWithAnnotations.kt + @EnumAnnotation(String(enum)) public? final? enum class MyEnumClass : R|kotlin/Enum| { + private [ContainingClassKey=MyEnumClass] constructor(): R|MyEnumClass| { + super|>() + } + + @Anno(String(implicit)) @PROPERTY:Anno(String(explicit)) public final static [ContainingClassKey=MyEnumClass] enum entry ENUM_ENTRY: R|MyEnumClass| = object : R|MyEnumClass| { + private [ContainingClassKey=] constructor(): R|| { + super() + } + + @Anno(String(init annotations)) init { + @Expression(String(expression annotation)) foo#() + } + + @FunAnno(String(fun)) public? final? fun foo(): @Anno(String(return type)) A<@Anno(String(nested return type)) B> { + } + + + + } + + public final static [ContainingClassKey=MyEnumClass] fun values(): R|kotlin/Array| { + } + + public final static [ContainingClassKey=MyEnumClass] fun valueOf(value: R|kotlin/String|): R|MyEnumClass| { + } + + public final static [ContainingClassKey=MyEnumClass] val entries: R|kotlin/enums/EnumEntries| + public get(): R|kotlin/enums/EnumEntries| + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt new file mode 100644 index 00000000000..bcdc6e452d6 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt @@ -0,0 +1,4 @@ +@file:FileAnnotation("file annotation") +@file:[Annotation1("foo") Annotation2] +@WithouTarget("argument") +package one \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.lazyBodies.txt new file mode 100644 index 00000000000..847346253c7 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.lazyBodies.txt @@ -0,0 +1,5 @@ +FILE: fileAnnotations.kt + @FILE:FileAnnotation(LAZY_EXPRESSION) + @FILE:Annotation1(LAZY_EXPRESSION) + @FILE:Annotation2() + @WithouTarget(LAZY_EXPRESSION) diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.txt new file mode 100644 index 00000000000..cc1e8f8cd2a --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.txt @@ -0,0 +1,5 @@ +FILE: fileAnnotations.kt + @FILE:FileAnnotation(String(file annotation)) + @FILE:Annotation1(String(foo)) + @FILE:Annotation2() + @WithouTarget(String(argument)) diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt new file mode 100644 index 00000000000..3a62eca2b67 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt @@ -0,0 +1,3 @@ +@file:FileAnnotation("file annotation") +@file:[Annotation1("foo") Annotation2] +@WithouTarget("argument") \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.lazyBodies.txt new file mode 100644 index 00000000000..88c9d832733 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.lazyBodies.txt @@ -0,0 +1,5 @@ +FILE: fileAnnotationsWithoutPackage.kt + @FILE:FileAnnotation(LAZY_EXPRESSION) + @FILE:Annotation1(LAZY_EXPRESSION) + @FILE:Annotation2() + @WithouTarget(LAZY_EXPRESSION) diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.txt new file mode 100644 index 00000000000..58361e1b337 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.txt @@ -0,0 +1,5 @@ +FILE: fileAnnotationsWithoutPackage.kt + @FILE:FileAnnotation(String(file annotation)) + @FILE:Annotation1(String(foo)) + @FILE:Annotation2() + @WithouTarget(String(argument)) diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt new file mode 100644 index 00000000000..4120a011b0f --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt @@ -0,0 +1,17 @@ +package util + +class A { + init { + class OuterIntoLocal { + fun doo() = foo() + fun foo() = bar() + fun baz() = foo() + } + + class LocalIntoLocal { + fun foo() = bar() + fun bar(): @Anno("bar $prop") List<@Anno("nested bar $prop") Collection<@Anno("nested nested bar $prop") Int>>? = null + fun foo2() = bar() + } + } +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.lazyBodies.txt new file mode 100644 index 00000000000..88f957bcbbd --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.lazyBodies.txt @@ -0,0 +1,9 @@ +FILE: initWithLocalDeclarations.kt + public? final? class A : R|kotlin/Any| { + public? constructor(): R|util/A| { + LAZY_super + } + + init { LAZY_BLOCK } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.txt new file mode 100644 index 00000000000..f0e27b3f556 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.txt @@ -0,0 +1,48 @@ +FILE: initWithLocalDeclarations.kt + public? final? class A : R|kotlin/Any| { + public? [ContainingClassKey=A] constructor(): R|util/A| { + super() + } + + init { + local final? class OuterIntoLocal : R|kotlin/Any| { + public? [ContainingClassKey=OuterIntoLocal] constructor(): R|/OuterIntoLocal| { + super() + } + + public? final? fun doo(): { + ^doo foo#() + } + + public? final? fun foo(): { + ^foo bar#() + } + + public? final? fun baz(): { + ^baz foo#() + } + + } + + local final? class LocalIntoLocal : R|kotlin/Any| { + public? [ContainingClassKey=LocalIntoLocal] constructor(): R|/LocalIntoLocal| { + super() + } + + public? final? fun foo(): { + ^foo bar#() + } + + public? final? fun bar(): @Anno((String(bar ), prop#)) List<@Anno((String(nested bar ), prop#)) Collection<@Anno((String(nested nested bar ), prop#)) Int>>? { + ^bar Null(null) + } + + public? final? fun foo2(): { + ^foo2 bar#() + } + + } + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt new file mode 100644 index 00000000000..b10544640f7 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt @@ -0,0 +1,167 @@ +fun foo() { + @Anno1 val a = @Anno2 1 + val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) { + @Anno foo() + } + + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + + } + } + } + + @Anno + class Local : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + @Anno + class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + @Anno1 val a = @Anno2 1 + val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) { + @Anno foo() + } + + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + + } + } + } + + @Anno + class Local : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + @Anno + class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + + } + + @Fun + fun localMember(): @FunType Int { + @Anno1 val a = @Anno2 1 + val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) { + @Anno foo() + } + + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + + } + } + } + + @Anno + class Local : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + @Anno + class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + + } + + @Fun + fun localMember(): @FunType Int { + + } + + @Prop + @get:Getter + @set:Setter + @setparam:Parameter + var localProperty: @PropType String = 1 + } + } + + @Prop + @get:Getter + @set:Setter + @setparam:Parameter + var localProperty: @PropType String = 1 + } + } + + @Fun + fun localMember(): @FunType Int { + @Anno1 val a = @Anno2 1 + val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) { + @Anno foo() + } + + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + + } + } + } + + @Anno + class Local : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + @Anno + class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + + } + + @Fun + fun localMember(): @FunType Int { + + } + + val localProperty: @PropType String + get() { + @Anno1 val a = @Anno2 1 + val b = @AnonymousFunction fun(@AnonymousParameter a: @AnonymousParameterType Int) { + @Anno foo() + } + + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + @Anno + fun boo(@Anno a: @Anno Int): @Anno Int { + + } + } + } + + @Anno + class Local : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + @Anno + class LocalNested : @SuperType SuperClass<@NestedSuperType A<@NestedNestedSuperType B>>(), @SuperInterfaceType SuperInterface<@NestedSuperInterfaceType A<@NestedNestedSuperInterfaceType B>>, @SuperDelegateType SuperInterface<@NestedSuperDelegateType A<@NestedNestedSuperDelegateType B>> by Component { + + } + + @Fun + fun localMember(): @FunType Int { + + } + + @Prop + @get:Getter + @set:Setter + @setparam:Parameter + var localProperty: @PropType String = 1 + } + } + } + } + + @Prop + @get:Getter + @set:Setter + @setparam:Parameter + var localProperty: @PropType String = 1 + } +} \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.lazyBodies.txt new file mode 100644 index 00000000000..8c35182c3ac --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.lazyBodies.txt @@ -0,0 +1,2 @@ +FILE: localAnnotations.kt + public? final? fun foo(): R|kotlin/Unit| { LAZY_BLOCK } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.txt new file mode 100644 index 00000000000..e91b13bfdfe --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.txt @@ -0,0 +1,202 @@ +FILE: localAnnotations.kt + public? final? fun foo(): R|kotlin/Unit| { + @Anno1() lval a: = @Anno2() IntegerLiteral(1) + lval b: = @AnonymousFunction() fun (@AnonymousParameter() a: @AnonymousParameterType() Int): R|kotlin/Unit| { + @Anno() foo#() + } + + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + } + + } + + } + + @Anno() local final? [DelegateFieldsMapKey={2=FirFieldSymbol /Local.$$delegate_0}] class Local : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=Local] constructor(): R|/Local| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + @Anno() local final? [ContainingClassKey=Local, DelegateFieldsMapKey={2=FirFieldSymbol /Local.LocalNested.$$delegate_0}] class LocalNested : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=LocalNested] constructor(): R|/Local.LocalNested| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + @Anno1() public? final? val a: = @Anno2() IntegerLiteral(1) + public? [ContainingClassKey=LocalNested] get(): + + public? final? val b: = @AnonymousFunction() fun (@AnonymousParameter() a: @AnonymousParameterType() Int): R|kotlin/Unit| { + @Anno() foo#() + } + + public? [ContainingClassKey=LocalNested] get(): + + @Anno() public? final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + } + + } + + } + + @Anno() local final? [ContainingClassKey=LocalNested, DelegateFieldsMapKey={2=FirFieldSymbol /Local.LocalNested.Local.$$delegate_0}] class Local : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=Local] constructor(): R|/Local.LocalNested.Local| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + @Anno() local final? [ContainingClassKey=Local, DelegateFieldsMapKey={2=FirFieldSymbol /Local.LocalNested.Local.LocalNested.$$delegate_0}] class LocalNested : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=LocalNested] constructor(): R|/Local.LocalNested.Local.LocalNested| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + } + + @Fun() public? final? fun localMember(): @FunType() Int { + @Anno1() lval a: = @Anno2() IntegerLiteral(1) + lval b: = @AnonymousFunction() fun (@AnonymousParameter() a: @AnonymousParameterType() Int): R|kotlin/Unit| { + @Anno() foo#() + } + + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + } + + } + + } + + @Anno() local final? [DelegateFieldsMapKey={2=FirFieldSymbol /Local.$$delegate_0}] class Local : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=Local] constructor(): R|/Local| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + @Anno() local final? [ContainingClassKey=Local, DelegateFieldsMapKey={2=FirFieldSymbol /Local.LocalNested.$$delegate_0}] class LocalNested : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=LocalNested] constructor(): R|/Local.LocalNested| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + } + + @Fun() public? final? fun localMember(): @FunType() Int { + } + + @Prop() public? final? var localProperty: @PropType() String = IntegerLiteral(1) + @PROPERTY_GETTER:Getter() public? [ContainingClassKey=Local] get(): @PropType() String + @PROPERTY_SETTER:Setter() public? [ContainingClassKey=Local] set(@SETTER_PARAMETER:Parameter() value: @PropType() String): R|kotlin/Unit| + + } + + } + + @Prop() public? final? var localProperty: @PropType() String = IntegerLiteral(1) + @PROPERTY_GETTER:Getter() public? [ContainingClassKey=Local] get(): @PropType() String + @PROPERTY_SETTER:Setter() public? [ContainingClassKey=Local] set(@SETTER_PARAMETER:Parameter() value: @PropType() String): R|kotlin/Unit| + + } + + } + + @Fun() public? final? fun localMember(): @FunType() Int { + @Anno1() lval a: = @Anno2() IntegerLiteral(1) + lval b: = @AnonymousFunction() fun (@AnonymousParameter() a: @AnonymousParameterType() Int): R|kotlin/Unit| { + @Anno() foo#() + } + + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + } + + } + + } + + @Anno() local final? [DelegateFieldsMapKey={2=FirFieldSymbol /Local.$$delegate_0}] class Local : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=Local] constructor(): R|/Local| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + @Anno() local final? [ContainingClassKey=Local, DelegateFieldsMapKey={2=FirFieldSymbol /Local.LocalNested.$$delegate_0}] class LocalNested : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=LocalNested] constructor(): R|/Local.LocalNested| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + } + + @Fun() public? final? fun localMember(): @FunType() Int { + } + + public? final? val localProperty: @PropType() String + public? [ContainingClassKey=Local] get(): @PropType() String { + @Anno1() lval a: = @Anno2() IntegerLiteral(1) + lval b: = @AnonymousFunction() fun (@AnonymousParameter() a: @AnonymousParameterType() Int): R|kotlin/Unit| { + @Anno() foo#() + } + + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + @Anno() local final? fun boo(@Anno() a: @Anno() Int): @Anno() Int { + } + + } + + } + + @Anno() local final? [DelegateFieldsMapKey={2=FirFieldSymbol /Local.$$delegate_0}] class Local : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=Local] constructor(): R|/Local| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + @Anno() local final? [ContainingClassKey=Local, DelegateFieldsMapKey={2=FirFieldSymbol /Local.LocalNested.$$delegate_0}] class LocalNested : @SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>, @SuperInterfaceType() SuperInterface<@NestedSuperInterfaceType() A<@NestedNestedSuperInterfaceType() B>>, @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> { + public? [ContainingClassKey=LocalNested] constructor(): R|/Local.LocalNested| { + super<@SuperType() SuperClass<@NestedSuperType() A<@NestedNestedSuperType() B>>>() + } + + private final field $$delegate_0: @SuperDelegateType() SuperInterface<@NestedSuperDelegateType() A<@NestedNestedSuperDelegateType() B>> = Component# + + } + + @Fun() public? final? fun localMember(): @FunType() Int { + } + + @Prop() public? final? var localProperty: @PropType() String = IntegerLiteral(1) + @PROPERTY_GETTER:Getter() public? [ContainingClassKey=Local] get(): @PropType() String + @PROPERTY_SETTER:Setter() public? [ContainingClassKey=Local] set(@SETTER_PARAMETER:Parameter() value: @PropType() String): R|kotlin/Unit| + + } + + } + + } + + } + + @Prop() public? final? var localProperty: @PropType() String = IntegerLiteral(1) + @PROPERTY_GETTER:Getter() public? [ContainingClassKey=Local] get(): @PropType() String + @PROPERTY_SETTER:Setter() public? [ContainingClassKey=Local] set(@SETTER_PARAMETER:Parameter() value: @PropType() String): R|kotlin/Unit| + + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt new file mode 100644 index 00000000000..9f886231f2b --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt @@ -0,0 +1,17 @@ +package second + +fun check() { + class A { + val bar get() = B().foo + fun baz() = B().doo() + + private inner class B { + var foo: @Anno(C::class) List<@Anno(C::class) Collection<@Anno(C::class) String>>? = null + fun doo(): @Anno(C::class) List<@Anno(C::class) Collection<@Anno(C::class) String>>? = null + private inner class C + } + } + + val a = A().bar + val b = A().baz() +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.lazyBodies.txt new file mode 100644 index 00000000000..6cb7e1490f4 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.lazyBodies.txt @@ -0,0 +1,2 @@ +FILE: localImplicitType.kt + public? final? fun check(): R|kotlin/Unit| { LAZY_BLOCK } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.txt new file mode 100644 index 00000000000..b96e3261646 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.txt @@ -0,0 +1,43 @@ +FILE: localImplicitType.kt + public? final? fun check(): R|kotlin/Unit| { + local final? class A : R|kotlin/Any| { + public? [ContainingClassKey=A] constructor(): R|/A| { + super() + } + + public? final? val bar: + public? [ContainingClassKey=A] get(): { + ^ B#().foo# + } + + public? final? fun baz(): { + ^baz B#().doo#() + } + + local final? inner [ContainingClassKey=A] class B : R|kotlin/Any| { + public? [ContainingClassKey=B] /A.constructor(): R|/A.B| { + super() + } + + public? final? var foo: @Anno((C#)) List<@Anno((C#)) Collection<@Anno((C#)) String>>? = Null(null) + public? [ContainingClassKey=B] get(): @Anno((C#)) List<@Anno((C#)) Collection<@Anno((C#)) String>>? + public? [ContainingClassKey=B] set(value: @Anno((C#)) List<@Anno((C#)) Collection<@Anno((C#)) String>>?): R|kotlin/Unit| + + public? final? fun doo(): @Anno((C#)) List<@Anno((C#)) Collection<@Anno((C#)) String>>? { + ^doo Null(null) + } + + local final? inner [ContainingClassKey=B] class C : R|kotlin/Any| { + public? [ContainingClassKey=C] /A.B.constructor(): R|/A.B.C| { + super() + } + + } + + } + + } + + lval a: = A#().bar# + lval b: = A#().baz#() + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt new file mode 100644 index 00000000000..2eb413cc101 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt @@ -0,0 +1,16 @@ +package util + +fun foo(): Int { + val prop = "str" + + @ForAnno("for anno $prop") + for (@ForParameter("for $prop") i in 1..100) {} + for (@ForParameter("second for $prop") (x, @NestedParam("destructuring in for $prop") y) in bar()) {} + withLambda { (@LeftLambda("lambda a $prop") a, @RightLambda("lambda b $prop") b) -> + + } + + @Destructuring("destr $prop") + val (@LeftDestructuring("a $prop") a, @RightDestructuring("b $prop") b) = Pair(0, 1) + return a + b +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.lazyBodies.txt new file mode 100644 index 00000000000..bae1d41a073 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.lazyBodies.txt @@ -0,0 +1,2 @@ +FILE: multiDeclarations.kt + public? final? fun foo(): Int { LAZY_BLOCK } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.txt new file mode 100644 index 00000000000..de858db4653 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.txt @@ -0,0 +1,41 @@ +FILE: multiDeclarations.kt + public? final? fun foo(): Int { + lval prop: = String(str) + @ForAnno((String(for anno ), prop#)) { + lval : = IntegerLiteral(1).rangeTo#(IntegerLiteral(100)).iterator#() + while(R|/|.hasNext#()) { + @ForParameter((String(for ), prop#)) lval i: = R|/|.next#() + { + } + + } + + } + + { + lval : = bar#().iterator#() + while(R|/|.hasNext#()) { + @ForParameter((String(second for ), prop#)) lval : = R|/|.next#() + lval x: = R|/|.component1#() + @NestedParam((String(destructuring in for ), prop#)) lval y: = R|/|.component2#() + { + } + + } + + } + + withLambda#( = withLambda@fun .(: ): { + @LeftLambda((String(lambda a ), prop#)) lval a: = R|/|.component1#() + @RightLambda((String(lambda b ), prop#)) lval b: = R|/|.component2#() + { + ^@withLambda Unit + } + + } + ) + @Destructuring((String(destr ), prop#)) lval : = Pair#(IntegerLiteral(0), IntegerLiteral(1)) + @LeftDestructuring((String(a ), prop#)) lval a: = R|/|.component1#() + @RightDestructuring((String(b ), prop#)) lval b: = R|/|.component2#() + ^foo a#.plus#(b#) + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts new file mode 100644 index 00000000000..98a6c1862b0 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts @@ -0,0 +1,7 @@ +package util + +@DestrAnno("destr 1 $prop") +val (@LeftAnno("a $prop") a, @RightAnno("b $prop") b) = 0 to 1 + +@Destr2Anno("destr 1 $prop") +val (@SecondLeftAnno("c $prop") c, @SecondRightAnno("d $prop") d) = 2 to 3 \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.lazyBodies.txt new file mode 100644 index 00000000000..4e2eb670b82 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.lazyBodies.txt @@ -0,0 +1,15 @@ +FILE: scriptLevelDestructuringWithAnnotation.kts + SCRIPT: + + @DestrAnno(LAZY_EXPRESSION) lval : = IntegerLiteral(0).to#(IntegerLiteral(1)) + @LeftAnno(LAZY_EXPRESSION) public final val a: = R|/|.component1#() + + + @RightAnno(LAZY_EXPRESSION) public final val b: = R|/|.component2#() + + + @Destr2Anno(LAZY_EXPRESSION) lval : = IntegerLiteral(2).to#(IntegerLiteral(3)) + @SecondLeftAnno(LAZY_EXPRESSION) public final val c: = R|/|.component1#() + + + @SecondRightAnno(LAZY_EXPRESSION) public final val d: = R|/|.component2#() diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.txt new file mode 100644 index 00000000000..b79616a75c4 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.txt @@ -0,0 +1,15 @@ +FILE: scriptLevelDestructuringWithAnnotation.kts + SCRIPT: + + @DestrAnno((String(destr 1 ), prop#)) [DestructuringDeclarationContainerVariableMarkerKey=true] lval : = IntegerLiteral(0).to#(IntegerLiteral(1)) + @LeftAnno((String(a ), prop#)) public final [DestructuringDeclarationContainerVariableKey=/] val a: = R|/|.component1#() + + + @RightAnno((String(b ), prop#)) public final [DestructuringDeclarationContainerVariableKey=/] val b: = R|/|.component2#() + + + @Destr2Anno((String(destr 1 ), prop#)) [DestructuringDeclarationContainerVariableMarkerKey=true] lval : = IntegerLiteral(2).to#(IntegerLiteral(3)) + @SecondLeftAnno((String(c ), prop#)) public final [DestructuringDeclarationContainerVariableKey=/] val c: = R|/|.component1#() + + + @SecondRightAnno((String(d ), prop#)) public final [DestructuringDeclarationContainerVariableKey=/] val d: = R|/|.component2#() diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts new file mode 100644 index 00000000000..f34e4206a2d --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts @@ -0,0 +1,11 @@ +package util + +if (true) { + @DestrAnno("destr 1 $prop") + val (@LeftAnno("a $prop") a, @RightAnno("b $prop") b) = 0 to 1 + + @Destr2Anno("destr 1 $prop") + val (@SecondLeftAnno("c $prop") c, @SecondRightAnno("d $prop") d) = 2 to 3 +} + +fun foo() {} \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.lazyBodies.txt new file mode 100644 index 00000000000..b8705488f69 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.lazyBodies.txt @@ -0,0 +1,15 @@ +FILE: scriptStatementLevelDestructuringWithAnnotation.kts + SCRIPT: + + when () { + Boolean(true) -> { + @DestrAnno(LAZY_EXPRESSION) lval : = IntegerLiteral(0).to#(IntegerLiteral(1)) + @LeftAnno(LAZY_EXPRESSION) lval a: = R|/|.component1#() + @RightAnno(LAZY_EXPRESSION) lval b: = R|/|.component2#() + @Destr2Anno(LAZY_EXPRESSION) lval : = IntegerLiteral(2).to#(IntegerLiteral(3)) + @SecondLeftAnno(LAZY_EXPRESSION) lval c: = R|/|.component1#() + @SecondRightAnno(LAZY_EXPRESSION) lval d: = R|/|.component2#() + } + } + + public? final? fun foo(): R|kotlin/Unit| { LAZY_BLOCK } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.txt new file mode 100644 index 00000000000..fd3ab9c825a --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.txt @@ -0,0 +1,16 @@ +FILE: scriptStatementLevelDestructuringWithAnnotation.kts + SCRIPT: + + when () { + Boolean(true) -> { + @DestrAnno((String(destr 1 ), prop#)) lval : = IntegerLiteral(0).to#(IntegerLiteral(1)) + @LeftAnno((String(a ), prop#)) lval a: = R|/|.component1#() + @RightAnno((String(b ), prop#)) lval b: = R|/|.component2#() + @Destr2Anno((String(destr 1 ), prop#)) lval : = IntegerLiteral(2).to#(IntegerLiteral(3)) + @SecondLeftAnno((String(c ), prop#)) lval c: = R|/|.component1#() + @SecondRightAnno((String(d ), prop#)) lval d: = R|/|.component2#() + } + } + + public? final? fun foo(): R|kotlin/Unit| { + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts new file mode 100644 index 00000000000..a668f4cd1cf --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts @@ -0,0 +1,9 @@ +package util + +if (true) { + @DestrAnno("destr 1 $prop") + val (@LeftAnno("a $prop") a, @RightAnno("b $prop") b) = 0 to 1 + + @Destr2Anno("destr 1 $prop") + val (@SecondLeftAnno("c $prop") c, @SecondRightAnno("d $prop") d) = 2 to 3 +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.lazyBodies.txt new file mode 100644 index 00000000000..00c2f3da919 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.lazyBodies.txt @@ -0,0 +1,13 @@ +FILE: scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts + SCRIPT: + + when () { + Boolean(true) -> { + @DestrAnno(LAZY_EXPRESSION) lval : = IntegerLiteral(0).to#(IntegerLiteral(1)) + @LeftAnno(LAZY_EXPRESSION) lval a: = R|/|.component1#() + @RightAnno(LAZY_EXPRESSION) lval b: = R|/|.component2#() + @Destr2Anno(LAZY_EXPRESSION) lval : = IntegerLiteral(2).to#(IntegerLiteral(3)) + @SecondLeftAnno(LAZY_EXPRESSION) lval c: = R|/|.component1#() + @SecondRightAnno(LAZY_EXPRESSION) lval d: = R|/|.component2#() + } + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.txt new file mode 100644 index 00000000000..fc402a6bca0 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.txt @@ -0,0 +1,13 @@ +FILE: scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts + SCRIPT: + + when () { + Boolean(true) -> { + @DestrAnno((String(destr 1 ), prop#)) lval : = IntegerLiteral(0).to#(IntegerLiteral(1)) + @LeftAnno((String(a ), prop#)) lval a: = R|/|.component1#() + @RightAnno((String(b ), prop#)) lval b: = R|/|.component2#() + @Destr2Anno((String(destr 1 ), prop#)) lval : = IntegerLiteral(2).to#(IntegerLiteral(3)) + @SecondLeftAnno((String(c ), prop#)) lval c: = R|/|.component1#() + @SecondRightAnno((String(d ), prop#)) lval d: = R|/|.component2#() + } + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt new file mode 100644 index 00000000000..d9e3c4eb00b --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt @@ -0,0 +1,14 @@ +package util + +@Target(AnnotationTarget.TYPE) +annotation class Anno(val position: String) + +const val prop = "str" + +abstract class AbstractClass + +class MyClass : @Anno("super type call $prop") AbstractClass<@Anno("nested super type ref $prop") List<@Anno("nested nested super type ref $prop") Int>> { + constructor(): super() { + + } +} diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.lazyBodies.txt new file mode 100644 index 00000000000..b1b240b19f9 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.lazyBodies.txt @@ -0,0 +1,22 @@ +FILE: secondaryConstructor.kt + @Target(LAZY_EXPRESSION) public? final? annotation class Anno : R|kotlin/Annotation| { + public? constructor(position: String): R|util/Anno| { + LAZY_super + } + + public? final? val position: String = R|/position| + public? get(): String + + } + public? final? const val prop: = LAZY_EXPRESSION + public? get(): + public? abstract class AbstractClass : R|kotlin/Any| { + public? constructor(): R|util/AbstractClass| { + LAZY_super + } + + } + public? final? class MyClass : @Anno(LAZY_EXPRESSION) AbstractClass<@Anno(LAZY_EXPRESSION) List<@Anno(LAZY_EXPRESSION) Int>> { + public? constructor(): R|util/MyClass| { LAZY_BLOCK } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.txt new file mode 100644 index 00000000000..f50ad838655 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.txt @@ -0,0 +1,24 @@ +FILE: secondaryConstructor.kt + @Target(AnnotationTarget#.TYPE#) public? final? annotation class Anno : R|kotlin/Annotation| { + public? [ContainingClassKey=Anno] constructor([CorrespondingProperty=util/Anno.position] position: String): R|util/Anno| { + super() + } + + public? final? [IsFromPrimaryConstructor=true] val position: String = R|/position| + public? [ContainingClassKey=Anno] get(): String + + } + public? final? const val prop: = String(str) + public? get(): + public? abstract class AbstractClass : R|kotlin/Any| { + public? [ContainingClassKey=AbstractClass] constructor(): R|util/AbstractClass| { + super() + } + + } + public? final? class MyClass : @Anno((String(super type call ), prop#)) AbstractClass<@Anno((String(nested super type ref ), prop#)) List<@Anno((String(nested nested super type ref ), prop#)) Int>> { + public? [ContainingClassKey=MyClass] constructor(): R|util/MyClass| { + super<>() + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt new file mode 100644 index 00000000000..87239aff721 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt @@ -0,0 +1,4 @@ +package util + +@Destructuring("destr $prop") +val (@LeftAnno("a $prop") a, @RightAnno("b $prop") b) = Pair(0, 1) \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.lazyBodies.txt new file mode 100644 index 00000000000..6a0572fcc1f --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.lazyBodies.txt @@ -0,0 +1,2 @@ +FILE: topLevelDestructuringWithAnnotation.kt + diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.txt new file mode 100644 index 00000000000..6a0572fcc1f --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.txt @@ -0,0 +1,2 @@ +FILE: topLevelDestructuringWithAnnotation.kt + diff --git a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java index 98ae2b847fa..77c04e2ea3c 100644 --- a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java +++ b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderLazyBodiesTestCaseGenerated.java @@ -56,6 +56,16 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnProperty.kt"); } + @TestMetadata("annotationOnSuperType.kt") + public void testAnnotationOnSuperType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt"); + } + + @TestMetadata("annotationOnSuperTypeCall.kt") + public void testAnnotationOnSuperTypeCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt"); + } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); @@ -66,6 +76,16 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @TestMetadata("anonymousObjectWithAnnotation.kt") + public void testAnonymousObjectWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt"); + } + + @TestMetadata("classLevelDestructuringWithAnnotation.kt") + public void testClassLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt"); + } + @TestMetadata("classWithWrongSuperCall.kt") public void testClassWithWrongSuperCall() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); @@ -86,6 +106,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt"); } + @TestMetadata("constructorWithLocalDeclarations.kt") + public void testConstructorWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt"); + } + @TestMetadata("contextReceivers.kt") public void testContextReceivers() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contextReceivers.kt"); @@ -101,11 +126,31 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingAnnotationsFileLevel.kt"); } + @TestMetadata("danglingConstrants.kt") + public void testDanglingConstrants() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt"); + } + + @TestMetadata("dataClassWithAnnotations.kt") + public void testDataClassWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt"); + } + + @TestMetadata("delegatedFieldNestedName.kt") + public void testDelegatedFieldNestedName() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt"); + } + @TestMetadata("delegates.kt") public void testDelegates() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.kt"); } + @TestMetadata("delegatesWithAnnotations.kt") + public void testDelegatesWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt"); + } + @TestMetadata("derivedClass.kt") public void testDerivedClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/derivedClass.kt"); @@ -116,6 +161,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/emptyAnonymousObject.kt"); } + @TestMetadata("enumEntryWithAnnotations.kt") + public void testEnumEntryWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt"); + } + @TestMetadata("enums.kt") public void testEnums() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enums.kt"); @@ -166,6 +216,16 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/F.kt"); } + @TestMetadata("fileAnnotations.kt") + public void testFileAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt"); + } + + @TestMetadata("fileAnnotationsWithoutPackage.kt") + public void testFileAnnotationsWithoutPackage() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt"); + } + @TestMetadata("functionTypes.kt") public void testFunctionTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionTypes.kt"); @@ -191,6 +251,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt"); } + @TestMetadata("initWithLocalDeclarations.kt") + public void testInitWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt"); + } + @TestMetadata("invalidDestructing.kt") public void testInvalidDestructing() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/invalidDestructing.kt"); @@ -206,11 +271,26 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/kotlinAnyNonTopLevel.kt"); } + @TestMetadata("localAnnotations.kt") + public void testLocalAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt"); + } + @TestMetadata("localDeclarationsInEnumEntry.kt") public void testLocalDeclarationsInEnumEntry() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localDeclarationsInEnumEntry.kt"); } + @TestMetadata("localImplicitType.kt") + public void testLocalImplicitType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt"); + } + + @TestMetadata("multiDeclarations.kt") + public void testMultiDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt"); + } + @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/nestedClass.kt"); @@ -246,6 +326,26 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/script.kts"); } + @TestMetadata("scriptLevelDestructuringWithAnnotation.kts") + public void testScriptLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts"); + } + + @TestMetadata("scriptStatementLevelDestructuringWithAnnotation.kts") + public void testScriptStatementLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts"); + } + + @TestMetadata("scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts") + public void testScriptStatementLevelDestructuringWithAnnotationAsLastStatement() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts"); + } + + @TestMetadata("secondaryConstructor.kt") + public void testSecondaryConstructor() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt"); + } + @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleClass.kt"); @@ -271,6 +371,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); } + @TestMetadata("topLevelDestructuringWithAnnotation.kt") + public void testTopLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt"); diff --git a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java index 5448a70176d..decc58dd62d 100644 --- a/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java +++ b/compiler/fir/raw-fir/psi2fir/tests-gen/org/jetbrains/kotlin/fir/builder/RawFirBuilderTestCaseGenerated.java @@ -56,6 +56,16 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnProperty.kt"); } + @TestMetadata("annotationOnSuperType.kt") + public void testAnnotationOnSuperType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperType.kt"); + } + + @TestMetadata("annotationOnSuperTypeCall.kt") + public void testAnnotationOnSuperTypeCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationOnSuperTypeCall.kt"); + } + @TestMetadata("annotationsOnNullableParenthesizedTypes.kt") public void testAnnotationsOnNullableParenthesizedTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnNullableParenthesizedTypes.kt"); @@ -66,6 +76,16 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @TestMetadata("anonymousObjectWithAnnotation.kt") + public void testAnonymousObjectWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/anonymousObjectWithAnnotation.kt"); + } + + @TestMetadata("classLevelDestructuringWithAnnotation.kt") + public void testClassLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classLevelDestructuringWithAnnotation.kt"); + } + @TestMetadata("classWithWrongSuperCall.kt") public void testClassWithWrongSuperCall() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); @@ -86,6 +106,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorOfAnonymousObject.kt"); } + @TestMetadata("constructorWithLocalDeclarations.kt") + public void testConstructorWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/constructorWithLocalDeclarations.kt"); + } + @TestMetadata("contextReceivers.kt") public void testContextReceivers() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contextReceivers.kt"); @@ -101,11 +126,31 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingAnnotationsFileLevel.kt"); } + @TestMetadata("danglingConstrants.kt") + public void testDanglingConstrants() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/danglingConstrants.kt"); + } + + @TestMetadata("dataClassWithAnnotations.kt") + public void testDataClassWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/dataClassWithAnnotations.kt"); + } + + @TestMetadata("delegatedFieldNestedName.kt") + public void testDelegatedFieldNestedName() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatedFieldNestedName.kt"); + } + @TestMetadata("delegates.kt") public void testDelegates() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegates.kt"); } + @TestMetadata("delegatesWithAnnotations.kt") + public void testDelegatesWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/delegatesWithAnnotations.kt"); + } + @TestMetadata("derivedClass.kt") public void testDerivedClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/derivedClass.kt"); @@ -116,6 +161,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/emptyAnonymousObject.kt"); } + @TestMetadata("enumEntryWithAnnotations.kt") + public void testEnumEntryWithAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enumEntryWithAnnotations.kt"); + } + @TestMetadata("enums.kt") public void testEnums() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/enums.kt"); @@ -166,6 +216,16 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/F.kt"); } + @TestMetadata("fileAnnotations.kt") + public void testFileAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotations.kt"); + } + + @TestMetadata("fileAnnotationsWithoutPackage.kt") + public void testFileAnnotationsWithoutPackage() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/fileAnnotationsWithoutPackage.kt"); + } + @TestMetadata("functionTypes.kt") public void testFunctionTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/functionTypes.kt"); @@ -191,6 +251,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initBlockWithDeclarations.kt"); } + @TestMetadata("initWithLocalDeclarations.kt") + public void testInitWithLocalDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/initWithLocalDeclarations.kt"); + } + @TestMetadata("invalidDestructing.kt") public void testInvalidDestructing() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/invalidDestructing.kt"); @@ -206,11 +271,26 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/kotlinAnyNonTopLevel.kt"); } + @TestMetadata("localAnnotations.kt") + public void testLocalAnnotations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localAnnotations.kt"); + } + @TestMetadata("localDeclarationsInEnumEntry.kt") public void testLocalDeclarationsInEnumEntry() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localDeclarationsInEnumEntry.kt"); } + @TestMetadata("localImplicitType.kt") + public void testLocalImplicitType() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/localImplicitType.kt"); + } + + @TestMetadata("multiDeclarations.kt") + public void testMultiDeclarations() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/multiDeclarations.kt"); + } + @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/nestedClass.kt"); @@ -246,6 +326,26 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/script.kts"); } + @TestMetadata("scriptLevelDestructuringWithAnnotation.kts") + public void testScriptLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts"); + } + + @TestMetadata("scriptStatementLevelDestructuringWithAnnotation.kts") + public void testScriptStatementLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts"); + } + + @TestMetadata("scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts") + public void testScriptStatementLevelDestructuringWithAnnotationAsLastStatement() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts"); + } + + @TestMetadata("secondaryConstructor.kt") + public void testSecondaryConstructor() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/secondaryConstructor.kt"); + } + @TestMetadata("simpleClass.kt") public void testSimpleClass() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleClass.kt"); @@ -271,6 +371,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/suspendFunctionTypes.kt"); } + @TestMetadata("topLevelDestructuringWithAnnotation.kt") + public void testTopLevelDestructuringWithAnnotation() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/topLevelDestructuringWithAnnotation.kt"); + } + @TestMetadata("typeAliasWithGeneric.kt") public void testTypeAliasWithGeneric() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/typeAliasWithGeneric.kt");