From 0a21669fb9c8a2b6ba0fed85984faf0dad2cafc5 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 15 Jan 2024 22:25:53 +0100 Subject: [PATCH] K2: reproduce KT-64982 --- ...CompilerTestFE10TestdataTestGenerated.java | 6 ++ ...sticCompilerFE10TestDataTestGenerated.java | 6 ++ ...eeOldFrontendDiagnosticsTestGenerated.java | 6 ++ ...siOldFrontendDiagnosticsTestGenerated.java | 6 ++ .../incompleteConstructorCall.fir.kt | 32 +++++++++ .../incompleteConstructorCall.fir.txt | 65 +++++++++++++++++++ .../incompleteConstructorCall.kt | 32 +++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 ++ 8 files changed, 159 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.kt create mode 100644 compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt create mode 100644 compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java index b526ee0aee6..350f77c9688 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosticCompilerTestFE10TestdataTestGenerated.java @@ -16144,6 +16144,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt"); } + @Test + @TestMetadata("incompleteConstructorCall.kt") + public void testIncompleteConstructorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt"); + } + @Test @TestMetadata("incompleteEquals.kt") public void testIncompleteEquals() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java index 574c0378584..2499c05023c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated.java @@ -16144,6 +16144,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt"); } + @Test + @TestMetadata("incompleteConstructorCall.kt") + public void testIncompleteConstructorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt"); + } + @Test @TestMetadata("incompleteEquals.kt") public void testIncompleteEquals() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java index 280aad3543d..5721610fcba 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirLightTreeOldFrontendDiagnosticsTestGenerated.java @@ -16138,6 +16138,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt"); } + @Test + @TestMetadata("incompleteConstructorCall.kt") + public void testIncompleteConstructorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt"); + } + @Test @TestMetadata("incompleteEquals.kt") public void testIncompleteEquals() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java index 1f38d0c16ab..b0a93ebb20e 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirPsiOldFrontendDiagnosticsTestGenerated.java @@ -16144,6 +16144,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt"); } + @Test + @TestMetadata("incompleteConstructorCall.kt") + public void testIncompleteConstructorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt"); + } + @Test @TestMetadata("incompleteEquals.kt") public void testIncompleteEquals() throws Exception { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.kt new file mode 100644 index 00000000000..684e82f5713 --- /dev/null +++ b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.kt @@ -0,0 +1,32 @@ +// ISSUE: KT-64982 +// FIR_DUMP + +class Outer { + companion object + + class Nested { + companion object + } + + inner class Inner { + companion object + } + + object Obj +} + +val test = Outer + +val test2 = Outer.Nested + +val test3 = Outer.Inner + +val test4 = Outer.Obj + +val test5 = Outer + +val test6 = Outer.Nested + +val test7 = Outer.Inner + +val test8 = Outer.Obj diff --git a/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt new file mode 100644 index 00000000000..82d754b05fd --- /dev/null +++ b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.fir.txt @@ -0,0 +1,65 @@ +FILE: incompleteConstructorCall.fir.kt + public final class Outer : R|kotlin/Any| { + public constructor(): R|Outer| { + super() + } + + public final companion object Companion : R|kotlin/Any| { + private constructor(): R|Outer.Companion| { + super() + } + + } + + public final class Nested : R|kotlin/Any| { + public constructor(): R|Outer.Nested| { + super() + } + + public final companion object Companion : R|kotlin/Any| { + private constructor(): R|Outer.Nested.Companion| { + super() + } + + } + + } + + public final inner class Inner : R|kotlin/Any| { + public Outer.constructor(): R|Outer.Inner| { + super() + } + + public final companion object Companion : R|kotlin/Any| { + private constructor(): R|Outer.Inner.Companion| { + super() + } + + } + + } + + public final object Obj : R|kotlin/Any| { + private constructor(): R|Outer.Obj| { + super() + } + + } + + } + public final val test: R|Outer.Companion| = Q|Outer| + public get(): R|Outer.Companion| + public final val test2: R|Outer.Nested.Companion| = Q|Outer.Nested| + public get(): R|Outer.Nested.Companion| + public final val test3: R|Outer.Inner.Companion| = R|kotlin/Double| + public get(): R|Outer.Inner.Companion| + public final val test4: R|Outer.Obj| = + public get(): R|Outer.Obj| + public final val test5: R|Outer.Companion| = Q|Outer| + public get(): R|Outer.Companion| + public final val test6: R|Outer.Nested.Companion| = Q|Outer.Nested| + public get(): R|Outer.Nested.Companion| + public final val test7: R|Outer.Inner.Companion| = Q|Outer.Inner| + public get(): R|Outer.Inner.Companion| + public final val test8: R|Outer.Obj| = Q|Outer.Obj| + public get(): R|Outer.Obj| diff --git a/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt new file mode 100644 index 00000000000..0448d489aa0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt @@ -0,0 +1,32 @@ +// ISSUE: KT-64982 +// FIR_DUMP + +class Outer { + companion object + + class Nested { + companion object + } + + inner class Inner { + companion object + } + + object Obj +} + +val test = Outer + +val test2 = Outer.Nested + +val test3 = Outer.Inner + +val test4 = Outer.Obj + +val test5 = Outer + +val test6 = Outer.Nested + +val test7 = Outer.Inner + +val test8 = Outer.Obj diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index ecc5d70d408..fdffddad2ee 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -16144,6 +16144,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteAssignment.kt"); } + @Test + @TestMetadata("incompleteConstructorCall.kt") + public void testIncompleteConstructorCall() throws Exception { + runTest("compiler/testData/diagnostics/tests/incompleteCode/incompleteConstructorCall.kt"); + } + @Test @TestMetadata("incompleteEquals.kt") public void testIncompleteEquals() throws Exception {