[FIR] KT-53988: Report ILLEGAL_SELECTOR for constants as selectors
Merge-request: KT-MR-7756 Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com> ^KT-53988 Fixed
This commit is contained in:
committed by
Space Team
parent
f627d81d53
commit
c5469d5fb5
+6
@@ -447,6 +447,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt53988.kt")
|
||||||
|
public void testKt53988() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt53988.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
+6
@@ -447,6 +447,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt53988.kt")
|
||||||
|
public void testKt53988() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt53988.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
+6
@@ -447,6 +447,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt53988.kt")
|
||||||
|
public void testKt53988() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt53988.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
@@ -227,7 +227,6 @@ open class RawFirBuilder(
|
|||||||
val callExpressionCallee = (this as? KtCallExpression)?.calleeExpression?.unwrapParenthesesLabelsAndAnnotations()
|
val callExpressionCallee = (this as? KtCallExpression)?.calleeExpression?.unwrapParenthesesLabelsAndAnnotations()
|
||||||
|
|
||||||
if (this is KtNameReferenceExpression ||
|
if (this is KtNameReferenceExpression ||
|
||||||
this is KtConstantExpression ||
|
|
||||||
(this is KtCallExpression && callExpressionCallee !is KtLambdaExpression) ||
|
(this is KtCallExpression && callExpressionCallee !is KtLambdaExpression) ||
|
||||||
getQualifiedExpressionForSelector() == null
|
getQualifiedExpressionForSelector() == null
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun main(args: Array<String>) {
|
||||||
|
return
|
||||||
|
.
|
||||||
|
<!ILLEGAL_SELECTOR, UNSIGNED_LITERAL_WITHOUT_DECLARATIONS_ON_CLASSPATH!>1u<!> // The expression cannot be a selector (occur after a dot)
|
||||||
|
throw AssertionError()
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
fun main(args: Array<String>) {
|
||||||
|
return
|
||||||
|
<!UNREACHABLE_CODE!>.
|
||||||
|
<!ILLEGAL_SELECTOR, UNSIGNED_LITERAL_WITHOUT_DECLARATIONS_ON_CLASSPATH!>1u<!><!> // The expression cannot be a selector (occur after a dot)
|
||||||
|
<!UNREACHABLE_CODE!>throw AssertionError()<!>
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
package
|
||||||
|
|
||||||
|
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||||
Generated
+6
@@ -447,6 +447,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
runTest("compiler/testData/diagnostics/tests/kt53.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt53988.kt")
|
||||||
|
public void testKt53988() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/kt53988.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("LValueAssignment.kt")
|
@TestMetadata("LValueAssignment.kt")
|
||||||
public void testLValueAssignment() throws Exception {
|
public void testLValueAssignment() throws Exception {
|
||||||
|
|||||||
-19
@@ -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
|
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
/*
|
/*
|
||||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||||
*
|
*
|
||||||
|
|||||||
-19
@@ -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
|
|
||||||
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
/*
|
/*
|
||||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user