From 04b9faf9e64a0872bf7d71481d573406be9986e1 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 15 Aug 2023 18:47:45 +0200 Subject: [PATCH] [LL FIR] fix getOrBuildFir for destructing declaration inside lambda parameter --- .../file/structure/FileStructureElement.kt | 2 + .../destructuring/destructuringDeclaration.kt | 7 ++++ .../destructuringDeclaration.txt | 32 +++++++++++++++ .../destructuringDeclarationInLambda.kt | 11 +++++ .../destructuringDeclarationInLambda.txt | 37 +++++++++++++++++ ...structuringDeclarationParameterInLambda.kt | 11 +++++ ...tructuringDeclarationParameterInLambda.txt | 37 +++++++++++++++++ .../entryInDestructuringDeclaration.kt | 7 ++++ .../entryInDestructuringDeclaration.txt | 32 +++++++++++++++ ...structuringDeclarationParameterInLambda.kt | 11 +++++ ...tructuringDeclarationParameterInLambda.txt | 37 +++++++++++++++++ ...ContentRootGetOrBuildFirTestGenerated.java | 40 +++++++++++++++++++ .../fir/ScriptGetOrBuildFirTestGenerated.java | 10 +++++ .../fir/SourceGetOrBuildFirTestGenerated.java | 40 +++++++++++++++++++ 14 files changed, 314 insertions(+) create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.kt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.txt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.kt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.txt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.kt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.txt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.kt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.txt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.kt create mode 100644 analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.txt diff --git a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FileStructureElement.kt b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FileStructureElement.kt index 742383fedc0..28c96c4f4e1 100644 --- a/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FileStructureElement.kt +++ b/analysis/low-level-api-fir/src/org/jetbrains/kotlin/analysis/low/level/api/fir/file/structure/FileStructureElement.kt @@ -114,6 +114,8 @@ internal class KtToFirMapping(firElement: FirElement) { } // Enum entries/annotation entries constructor calls is KtConstructorCalleeExpression -> getElement(current.parent as KtCallElement) + // KtParameter for destructuring declaration + is KtParameter -> getElement(current as KtElement) else -> null } } diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.kt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.kt new file mode 100644 index 00000000000..c41126a3665 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.kt @@ -0,0 +1,7 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtDestructuringDeclaration + +data class X(val a: Int, val b: Int) + +fun main(x: X) { + val (a, b) = x +} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.txt new file mode 100644 index 00000000000..9048a59b469 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.txt @@ -0,0 +1,32 @@ +KT element: KtDestructuringDeclaration +FIR element: FirPropertyImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +[ResolvedTo(BODY_RESOLVE)] lval : R|X| = R|/x| + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] destructuringDeclaration.kt + public final data [ResolvedTo(STATUS)] class X : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=X] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/X.a] a: R|kotlin/Int|, [ResolvedTo(STATUS)] [CorrespondingProperty=/X.b] b: R|kotlin/Int|): R|X| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component1, IsFromPrimaryConstructor=true] val a: R|kotlin/Int| = R|/a| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component2, IsFromPrimaryConstructor=true] val b: R|kotlin/Int| = R|/b| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component1(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component2(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] fun copy([ResolvedTo(STATUS)] a: R|kotlin/Int| = this@R|/X|.R|/X.a|, [ResolvedTo(STATUS)] b: R|kotlin/Int| = this@R|/X|.R|/X.b|): R|X| + + } + public final [ResolvedTo(BODY_RESOLVE)] fun main([ResolvedTo(BODY_RESOLVE)] x: R|X|): R|kotlin/Unit| { + [ResolvedTo(BODY_RESOLVE)] lval : R|X| = R|/x| + [ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + [ResolvedTo(BODY_RESOLVE)] lval b: R|kotlin/Int| = R|/|.R|/X.component2|() + } \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.kt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.kt new file mode 100644 index 00000000000..2da8996589d --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.kt @@ -0,0 +1,11 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtDestructuringDeclaration + +data class X(val a: Int, val b: Int) + +fun x(action: (X) -> Unit) {} + +fun main() { + x { (a, b) -> + + } +} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.txt new file mode 100644 index 00000000000..b595982e8ce --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.txt @@ -0,0 +1,37 @@ +KT element: KtDestructuringDeclaration +FIR element: FirValueParameterImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +[ResolvedTo(BODY_RESOLVE)] : R|X| + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] destructuringDeclarationInLambda.kt + public final data [ResolvedTo(STATUS)] class X : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=X] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/X.a] a: R|kotlin/Int|, [ResolvedTo(STATUS)] [CorrespondingProperty=/X.b] b: R|kotlin/Int|): R|X| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component1, IsFromPrimaryConstructor=true] val a: R|kotlin/Int| = R|/a| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component2, IsFromPrimaryConstructor=true] val b: R|kotlin/Int| = R|/b| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component1(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component2(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] fun copy([ResolvedTo(STATUS)] a: R|kotlin/Int| = this@R|/X|.R|/X.a|, [ResolvedTo(STATUS)] b: R|kotlin/Int| = this@R|/X|.R|/X.b|): R|X| + + } + public final [ResolvedTo(CONTRACTS)] fun x([ResolvedTo(CONTRACTS)] action: R|(X) -> kotlin/Unit|): R|kotlin/Unit| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun main(): R|kotlin/Unit| { + R|/x|( = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function1] x@fun ([ResolvedTo(BODY_RESOLVE)] : R|X|): R|kotlin/Unit| { + [ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + [ResolvedTo(BODY_RESOLVE)] lval b: R|kotlin/Int| = R|/|.R|/X.component2|() + ^@x Unit + } + ) + } \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.kt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.kt new file mode 100644 index 00000000000..240f289476b --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.kt @@ -0,0 +1,11 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtParameter + +data class X(val a: Int, val b: Int) + +fun x(action: (X, Int) -> Unit) {} + +fun main() { + x { (a, b), i -> + + } +} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.txt new file mode 100644 index 00000000000..d350f57f025 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.txt @@ -0,0 +1,37 @@ +KT element: KtParameter +FIR element: FirValueParameterImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +[ResolvedTo(BODY_RESOLVE)] : R|X| + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] destructuringDeclarationParameterInLambda.kt + public final data [ResolvedTo(STATUS)] class X : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=X] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/X.a] a: R|kotlin/Int|, [ResolvedTo(STATUS)] [CorrespondingProperty=/X.b] b: R|kotlin/Int|): R|X| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component1, IsFromPrimaryConstructor=true] val a: R|kotlin/Int| = R|/a| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component2, IsFromPrimaryConstructor=true] val b: R|kotlin/Int| = R|/b| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component1(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component2(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] fun copy([ResolvedTo(STATUS)] a: R|kotlin/Int| = this@R|/X|.R|/X.a|, [ResolvedTo(STATUS)] b: R|kotlin/Int| = this@R|/X|.R|/X.b|): R|X| + + } + public final [ResolvedTo(CONTRACTS)] fun x([ResolvedTo(CONTRACTS)] action: R|(X, kotlin/Int) -> kotlin/Unit|): R|kotlin/Unit| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun main(): R|kotlin/Unit| { + R|/x|( = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function2] x@fun ([ResolvedTo(BODY_RESOLVE)] : R|X|, [ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Unit| { + [ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + [ResolvedTo(BODY_RESOLVE)] lval b: R|kotlin/Int| = R|/|.R|/X.component2|() + ^@x Unit + } + ) + } \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.kt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.kt new file mode 100644 index 00000000000..47e5b6cb71d --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.kt @@ -0,0 +1,7 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry + +data class X(val a: Int, val b: Int) + +fun main(x: X) { + val (a, b) = x +} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.txt new file mode 100644 index 00000000000..010a0357d82 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.txt @@ -0,0 +1,32 @@ +KT element: KtDestructuringDeclarationEntry +FIR element: FirPropertyImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +[ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] entryInDestructuringDeclaration.kt + public final data [ResolvedTo(STATUS)] class X : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=X] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/X.a] a: R|kotlin/Int|, [ResolvedTo(STATUS)] [CorrespondingProperty=/X.b] b: R|kotlin/Int|): R|X| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component1, IsFromPrimaryConstructor=true] val a: R|kotlin/Int| = R|/a| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component2, IsFromPrimaryConstructor=true] val b: R|kotlin/Int| = R|/b| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component1(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component2(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] fun copy([ResolvedTo(STATUS)] a: R|kotlin/Int| = this@R|/X|.R|/X.a|, [ResolvedTo(STATUS)] b: R|kotlin/Int| = this@R|/X|.R|/X.b|): R|X| + + } + public final [ResolvedTo(BODY_RESOLVE)] fun main([ResolvedTo(BODY_RESOLVE)] x: R|X|): R|kotlin/Unit| { + [ResolvedTo(BODY_RESOLVE)] lval : R|X| = R|/x| + [ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + [ResolvedTo(BODY_RESOLVE)] lval b: R|kotlin/Int| = R|/|.R|/X.component2|() + } \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.kt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.kt new file mode 100644 index 00000000000..5fcc54f7fbb --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.kt @@ -0,0 +1,11 @@ +// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry + +data class X(val a: Int, val b: Int) + +fun x(action: (X) -> Unit) {} + +fun main() { + x { (a, b) -> + + } +} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.txt b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.txt new file mode 100644 index 00000000000..76300270676 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.txt @@ -0,0 +1,37 @@ +KT element: KtDestructuringDeclarationEntry +FIR element: FirPropertyImpl +FIR source kind: KtRealSourceElementKind + +FIR element rendered: +[ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + +FIR FILE: +FILE: [ResolvedTo(IMPORTS)] entryInDestructuringDeclarationParameterInLambda.kt + public final data [ResolvedTo(STATUS)] class X : R|kotlin/Any| { + public [ResolvedTo(STATUS)] [ContainingClassKey=X] constructor([ResolvedTo(STATUS)] [CorrespondingProperty=/X.a] a: R|kotlin/Int|, [ResolvedTo(STATUS)] [CorrespondingProperty=/X.b] b: R|kotlin/Int|): R|X| { + LAZY_super + } + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component1, IsFromPrimaryConstructor=true] val a: R|kotlin/Int| = R|/a| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] [ComponentFunctionSymbolKey=/X.component2, IsFromPrimaryConstructor=true] val b: R|kotlin/Int| = R|/b| + public [ResolvedTo(STATUS)] [ContainingClassKey=X] get(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component1(): R|kotlin/Int| + + public final operator [ResolvedTo(CONTRACTS)] fun component2(): R|kotlin/Int| + + public final [ResolvedTo(STATUS)] fun copy([ResolvedTo(STATUS)] a: R|kotlin/Int| = this@R|/X|.R|/X.a|, [ResolvedTo(STATUS)] b: R|kotlin/Int| = this@R|/X|.R|/X.b|): R|X| + + } + public final [ResolvedTo(CONTRACTS)] fun x([ResolvedTo(CONTRACTS)] action: R|(X) -> kotlin/Unit|): R|kotlin/Unit| { + } + public final [ResolvedTo(BODY_RESOLVE)] fun main(): R|kotlin/Unit| { + R|/x|( = [ResolvedTo(BODY_RESOLVE)] [MatchingParameterFunctionTypeKey=kotlin/Function1] x@fun ([ResolvedTo(BODY_RESOLVE)] : R|X|): R|kotlin/Unit| { + [ResolvedTo(BODY_RESOLVE)] lval a: R|kotlin/Int| = R|/|.R|/X.component1|() + [ResolvedTo(BODY_RESOLVE)] lval b: R|kotlin/Int| = R|/|.R|/X.component2|() + ^@x Unit + } + ) + } \ No newline at end of file diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java index d5d48530c79..63e55de63a0 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/OutOfContentRootGetOrBuildFirTestGenerated.java @@ -568,6 +568,46 @@ public class OutOfContentRootGetOrBuildFirTestGenerated extends AbstractOutOfCon } } + @Nested + @TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring") + @TestDataPath("$PROJECT_ROOT") + public class Destructuring { + @Test + public void testAllFilesPresentInDestructuring() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring"), Pattern.compile("^(.+)\\.(kt)$"), null, true); + } + + @Test + @TestMetadata("destructuringDeclaration.kt") + public void testDestructuringDeclaration() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.kt"); + } + + @Test + @TestMetadata("destructuringDeclarationInLambda.kt") + public void testDestructuringDeclarationInLambda() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.kt"); + } + + @Test + @TestMetadata("destructuringDeclarationParameterInLambda.kt") + public void testDestructuringDeclarationParameterInLambda() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.kt"); + } + + @Test + @TestMetadata("entryInDestructuringDeclaration.kt") + public void testEntryInDestructuringDeclaration() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.kt"); + } + + @Test + @TestMetadata("entryInDestructuringDeclarationParameterInLambda.kt") + public void testEntryInDestructuringDeclarationParameterInLambda() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.kt"); + } + } + @Nested @TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/expressions") @TestDataPath("$PROJECT_ROOT") diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptGetOrBuildFirTestGenerated.java index d7d99f4ae34..cfa35cb8a7c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptGetOrBuildFirTestGenerated.java @@ -412,6 +412,16 @@ public class ScriptGetOrBuildFirTestGenerated extends AbstractScriptGetOrBuildFi } } + @Nested + @TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring") + @TestDataPath("$PROJECT_ROOT") + public class Destructuring { + @Test + public void testAllFilesPresentInDestructuring() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring"), Pattern.compile("^(.+)\\.(kts)$"), null, true); + } + } + @Nested @TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/expressions") @TestDataPath("$PROJECT_ROOT") diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java index 2f5030460c1..32e0046eac2 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/SourceGetOrBuildFirTestGenerated.java @@ -568,6 +568,46 @@ public class SourceGetOrBuildFirTestGenerated extends AbstractSourceGetOrBuildFi } } + @Nested + @TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring") + @TestDataPath("$PROJECT_ROOT") + public class Destructuring { + @Test + public void testAllFilesPresentInDestructuring() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring"), Pattern.compile("^(.+)\\.(kt)$"), null, true); + } + + @Test + @TestMetadata("destructuringDeclaration.kt") + public void testDestructuringDeclaration() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclaration.kt"); + } + + @Test + @TestMetadata("destructuringDeclarationInLambda.kt") + public void testDestructuringDeclarationInLambda() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationInLambda.kt"); + } + + @Test + @TestMetadata("destructuringDeclarationParameterInLambda.kt") + public void testDestructuringDeclarationParameterInLambda() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/destructuringDeclarationParameterInLambda.kt"); + } + + @Test + @TestMetadata("entryInDestructuringDeclaration.kt") + public void testEntryInDestructuringDeclaration() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclaration.kt"); + } + + @Test + @TestMetadata("entryInDestructuringDeclarationParameterInLambda.kt") + public void testEntryInDestructuringDeclarationParameterInLambda() throws Exception { + runTest("analysis/low-level-api-fir/testdata/getOrBuildFir/destructuring/entryInDestructuringDeclarationParameterInLambda.kt"); + } + } + @Nested @TestMetadata("analysis/low-level-api-fir/testdata/getOrBuildFir/expressions") @TestDataPath("$PROJECT_ROOT")