diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 22a716e5477..6d563b93e78 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -447,6 +447,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/kt53.kt"); } + @Test + @TestMetadata("kt53988.kt") + public void testKt53988() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt53988.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index eb3a3a835d4..9014cc39bec 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -447,6 +447,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/kt53.kt"); } + @Test + @TestMetadata("kt53988.kt") + public void testKt53988() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt53988.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 877b0256463..b645cebeb11 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -447,6 +447,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/kt53.kt"); } + @Test + @TestMetadata("kt53988.kt") + public void testKt53988() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt53988.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index 2cde223338d..f87d981ad2d 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -227,7 +227,6 @@ open class RawFirBuilder( val callExpressionCallee = (this as? KtCallExpression)?.calleeExpression?.unwrapParenthesesLabelsAndAnnotations() if (this is KtNameReferenceExpression || - this is KtConstantExpression || (this is KtCallExpression && callExpressionCallee !is KtLambdaExpression) || getQualifiedExpressionForSelector() == null ) { diff --git a/compiler/testData/diagnostics/tests/kt53988.fir.kt b/compiler/testData/diagnostics/tests/kt53988.fir.kt new file mode 100644 index 00000000000..b5a6e2bd78b --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt53988.fir.kt @@ -0,0 +1,6 @@ +fun main(args: Array) { + return + . + 1u // The expression cannot be a selector (occur after a dot) + throw AssertionError() +} diff --git a/compiler/testData/diagnostics/tests/kt53988.kt b/compiler/testData/diagnostics/tests/kt53988.kt new file mode 100644 index 00000000000..6edca04a05a --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt53988.kt @@ -0,0 +1,6 @@ +fun main(args: Array) { + return + . + 1u // The expression cannot be a selector (occur after a dot) + throw AssertionError() +} diff --git a/compiler/testData/diagnostics/tests/kt53988.txt b/compiler/testData/diagnostics/tests/kt53988.txt new file mode 100644 index 00000000000..49ba831837b --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt53988.txt @@ -0,0 +1,3 @@ +package + +public fun main(/*0*/ args: kotlin.Array): kotlin.Unit 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 bc8022d9598..cfee8825657 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 @@ -447,6 +447,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/kt53.kt"); } + @Test + @TestMetadata("kt53988.kt") + public void testKt53988() throws Exception { + runTest("compiler/testData/diagnostics/tests/kt53988.kt"); + } + @Test @TestMetadata("LValueAssignment.kt") public void testLValueAssignment() throws Exception { diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.fir.kt deleted file mode 100644 index 11100eaa0d1..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// TESTCASE NUMBER: 1 -val value_1 = 0./**/99901 - -// TESTCASE NUMBER: 2 -val value_2 = 2./** some doc */1 - -// TESTCASE NUMBER: 3 -val value_3 = 9999./** some doc *//**/1 - -// TESTCASE NUMBER: 4 -val value_4 = 9999./** some /** some doc */ doc */1 - -// TESTCASE NUMBER: 5 -val value_5 = 9999./**/ -1 - -// TESTCASE NUMBER: 6 -val value_6 = 1000000.//0 -0 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.kt index b90e1722908..48e0b8b0e3d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) * diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.fir.kt deleted file mode 100644 index 58b37b5165b..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// TESTCASE NUMBER: 1 -val value_1 = 0./**/99901f - -// TESTCASE NUMBER: 2 -val value_2 = 2./** some doc */1F - -// TESTCASE NUMBER: 3 -val value_3 = 9999./** some doc *//**/1f - -// TESTCASE NUMBER: 4 -val value_4 = 9999./** some /** some doc */ doc */1f - -// TESTCASE NUMBER: 5 -val value_5 = 9999./**/ -1F - -// TESTCASE NUMBER: 6 -val value_6 = 1000000.//0 -0F diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.kt index 5bd676a97d5..a389121a0c7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL /* * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) *