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 21d0b779ddb..ef10cc79c8f 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,12 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @Test + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() 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 bda140bc36d..0fa86774e18 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,12 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @Test + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() 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 0c885bdb4cc..a53b6d2c235 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,11 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.kt"); diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt new file mode 100644 index 00000000000..a1f38602ea3 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt @@ -0,0 +1,51 @@ +open class A(init: A.() -> Unit) { + val prop: String = "" +} + +object B : A({}) + +object C : A( + { + fun foo() = B.prop.toString() + } +) + +class D : A( + { + fun foo() = B.prop.toString() + } +) + +class E() : A( + { + fun foo() = B.prop.toString() + } +) + +class F : A( + { + fun foo() = B.prop.toString() + } +) { + constructor() +} + +class G : A( + { + fun foo() = B.prop.toString() + } +) { + constructor() : super( + { + fun foo() = C.prop.toString() + } + ) +} + +class H : A { + constructor() : super( + { + fun foo() = B.prop.toString() + } + ) +} \ No newline at end of file diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.lazyBodies.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.lazyBodies.txt new file mode 100644 index 00000000000..f18877a52d7 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.lazyBodies.txt @@ -0,0 +1,52 @@ +FILE: classWithWrongSuperCall.kt + public? open class A : R|kotlin/Any| { + public? constructor(init: ( A.() -> Unit )): R|A| { + LAZY_super + } + + public? final? val prop: String = LAZY_EXPRESSION + public? get(): String + + } + public? final? object B : A { + private constructor(): R|B| { + LAZY_super + } + + } + public? final? object C : A { + private constructor(): R|C| { + LAZY_super + } + + } + public? final? class D : A { + public? constructor(): R|D| { + LAZY_super + } + + } + public? final? class E : A { + public? constructor(): R|E| { + LAZY_super + } + + } + public? final? class F : A { + public? constructor(): R|F| { + LAZY_super + } + + } + public? final? class G : A { + public? constructor(): R|G| { + LAZY_super + } + + } + public? final? class H : A { + public? constructor(): R|H| { + LAZY_super<> + } + + } diff --git a/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.txt b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.txt new file mode 100644 index 00000000000..2233fd84d53 --- /dev/null +++ b/compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.txt @@ -0,0 +1,85 @@ +FILE: classWithWrongSuperCall.kt + public? open class A : R|kotlin/Any| { + public? [ContainingClassKey=A] constructor(init: ( A.() -> Unit )): R|A| { + super() + } + + public? final? val prop: String = String() + public? [ContainingClassKey=A] get(): String + + } + public? final? object B : A { + private [ContainingClassKey=B] constructor(): R|B| { + super(fun .(): { + ^ Unit + } + ) + } + + } + public? final? object C : A { + private [ContainingClassKey=C] constructor(): R|C| { + super(fun .(): { + local final? fun foo(): { + ^foo B#.prop#.toString#() + } + + } + ) + } + + } + public? final? class D : A { + public? [ContainingClassKey=D] constructor(): R|D| { + super(fun .(): { + local final? fun foo(): { + ^foo B#.prop#.toString#() + } + + } + ) + } + + } + public? final? class E : A { + public? [ContainingClassKey=E] constructor(): R|E| { + super(fun .(): { + local final? fun foo(): { + ^foo B#.prop#.toString#() + } + + } + ) + } + + } + public? final? class F : A { + public? [ContainingClassKey=F] constructor(): R|F| { + super() + } + + } + public? final? class G : A { + public? [ContainingClassKey=G] constructor(): R|G| { + super(fun .(): { + local final? fun foo(): { + ^foo C#.prop#.toString#() + } + + } + ) + } + + } + public? final? class H : A { + public? [ContainingClassKey=H] constructor(): R|H| { + super<>(fun .(): { + local final? fun foo(): { + ^foo B#.prop#.toString#() + } + + } + ) + } + + } 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 bc0191db11a..82dac171269 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,11 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.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 2090c4c04e6..13558ecb5c6 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,11 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/complexTypes.kt"); diff --git a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java index 62893c2cf7f..19368fd15ce 100644 --- a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java +++ b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/fir/FirVisualizerForRawFirDataGenerated.java @@ -51,6 +51,12 @@ public class FirVisualizerForRawFirDataGenerated extends AbstractFirVisualizerTe runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @Test + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception { diff --git a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java index a9680be3597..9053e1e5750 100644 --- a/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java +++ b/compiler/visualizer/tests-gen/org/jetbrains/kotlin/visualizer/psi/PsiVisualizerForRawFirDataGenerated.java @@ -51,6 +51,12 @@ public class PsiVisualizerForRawFirDataGenerated extends AbstractPsiVisualizerTe runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/annotationsOnParenthesizedTypes.kt"); } + @Test + @TestMetadata("classWithWrongSuperCall.kt") + public void testClassWithWrongSuperCall() throws Exception { + runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/classWithWrongSuperCall.kt"); + } + @Test @TestMetadata("complexTypes.kt") public void testComplexTypes() throws Exception {