[FIR] Fix crash on assignment expression with incorrect lvalue with LT mode

^KT-65241 Fixed
This commit is contained in:
Ivan Kochurkin
2024-02-13 15:18:57 +01:00
committed by Space Team
parent c2e28149e6
commit 9a86b83a0c
9 changed files with 48 additions and 1 deletions
@@ -13184,6 +13184,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/exceptions/annotationWithWrongArgInDanglingModifierList.kt");
}
@Test
@TestMetadata("assignmentWithIncorrectLValue.kt")
public void testAssignmentWithIncorrectLValue() {
runTest("compiler/testData/diagnostics/tests/exceptions/assignmentWithIncorrectLValue.kt");
}
@Test
@TestMetadata("expectedSomeTypesOnBranchForWhenExpressionOfErroneousType.kt")
public void testExpectedSomeTypesOnBranchForWhenExpressionOfErroneousType() {
@@ -13184,6 +13184,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/exceptions/annotationWithWrongArgInDanglingModifierList.kt");
}
@Test
@TestMetadata("assignmentWithIncorrectLValue.kt")
public void testAssignmentWithIncorrectLValue() {
runTest("compiler/testData/diagnostics/tests/exceptions/assignmentWithIncorrectLValue.kt");
}
@Test
@TestMetadata("expectedSomeTypesOnBranchForWhenExpressionOfErroneousType.kt")
public void testExpectedSomeTypesOnBranchForWhenExpressionOfErroneousType() {
@@ -13178,6 +13178,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
runTest("compiler/testData/diagnostics/tests/exceptions/annotationWithWrongArgInDanglingModifierList.kt");
}
@Test
@TestMetadata("assignmentWithIncorrectLValue.kt")
public void testAssignmentWithIncorrectLValue() {
runTest("compiler/testData/diagnostics/tests/exceptions/assignmentWithIncorrectLValue.kt");
}
@Test
@TestMetadata("expectedSomeTypesOnBranchForWhenExpressionOfErroneousType.kt")
public void testExpectedSomeTypesOnBranchForWhenExpressionOfErroneousType() {
@@ -13184,6 +13184,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
runTest("compiler/testData/diagnostics/tests/exceptions/annotationWithWrongArgInDanglingModifierList.kt");
}
@Test
@TestMetadata("assignmentWithIncorrectLValue.kt")
public void testAssignmentWithIncorrectLValue() {
runTest("compiler/testData/diagnostics/tests/exceptions/assignmentWithIncorrectLValue.kt");
}
@Test
@TestMetadata("expectedSomeTypesOnBranchForWhenExpressionOfErroneousType.kt")
public void testExpectedSomeTypesOnBranchForWhenExpressionOfErroneousType() {
@@ -625,7 +625,7 @@ class LightTreeRawFirExpressionBuilder(
}
return result ?: buildErrorExpression {
source = null
source = dotQualifiedExpression.toFirSourceElement()
diagnostic = ConeSyntaxDiagnostic("Qualified expression without selector")
// if there is no selector, we still want to resolve the receiver
@@ -0,0 +1,7 @@
// ISSUE: KT-65241
object A
fun test() {
A.<!SYNTAX!>else<!> = <!ASSIGNMENT_TYPE_MISMATCH!>42<!>
}
@@ -0,0 +1,7 @@
// ISSUE: KT-65241
object A
fun test() {
A.<!SYNTAX!>else<!> = 42
}
@@ -3,6 +3,9 @@ ERR:
test.kt:4:13: error: classifier 'class System : Any' does not have a companion object, so it cannot be used as an expression.
val s = System.in
^^^^^^
test.kt:4:13: error: syntax error: Qualified expression without selector.
val s = System.in
^^^^^^^^^
test.kt:4:20: error: syntax error: Expecting an element.
val s = System.in
^^
@@ -13184,6 +13184,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/tests/exceptions/annotationWithWrongArgInDanglingModifierList.kt");
}
@Test
@TestMetadata("assignmentWithIncorrectLValue.kt")
public void testAssignmentWithIncorrectLValue() {
runTest("compiler/testData/diagnostics/tests/exceptions/assignmentWithIncorrectLValue.kt");
}
@Test
@TestMetadata("expectedSomeTypesOnBranchForWhenExpressionOfErroneousType.kt")
public void testExpectedSomeTypesOnBranchForWhenExpressionOfErroneousType() {