diff --git a/analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.kts b/analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.kts new file mode 100644 index 00000000000..b3e350ea570 --- /dev/null +++ b/analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.kts @@ -0,0 +1,3 @@ +for ((index, _) in emptyList().withIndex()) { + +} diff --git a/analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.txt b/analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.txt new file mode 100644 index 00000000000..4b906e90aeb --- /dev/null +++ b/analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.txt @@ -0,0 +1,4 @@ +/* anchor --> */for (/* anchor --> */(index, _)/* <-- */ in emptyList().withIndex()) { + +} +/* <-- */ diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptNonLocalDeclarationAnchorTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptNonLocalDeclarationAnchorTestGenerated.java index 5a91caf7383..b618803268d 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptNonLocalDeclarationAnchorTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/ScriptNonLocalDeclarationAnchorTestGenerated.java @@ -41,4 +41,10 @@ public class ScriptNonLocalDeclarationAnchorTestGenerated extends AbstractScript public void testStatements() throws Exception { runTest("analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/statements.kts"); } + + @Test + @TestMetadata("topLevelFor.kts") + public void testTopLevelFor() throws Exception { + runTest("analysis/low-level-api-fir/testdata/nonLocalDeclarationAnchors/topLevelFor.kts"); + } }