[FIR] DFA: add missing unwrap for FirDesugaredAssignmentValueReferenceExpression
^KT-60319 Fixed ^KT-61407 Fixed
This commit is contained in:
committed by
Space Team
parent
c01d27a61e
commit
3debf36d60
+6
@@ -8248,6 +8248,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("desugaredAssignment.kt")
|
||||||
|
public void testDesugaredAssignment() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/dataFlow/desugaredAssignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("EmptyIf.kt")
|
@TestMetadata("EmptyIf.kt")
|
||||||
public void testEmptyIf() throws Exception {
|
public void testEmptyIf() throws Exception {
|
||||||
|
|||||||
+6
@@ -8248,6 +8248,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("desugaredAssignment.kt")
|
||||||
|
public void testDesugaredAssignment() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/dataFlow/desugaredAssignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("EmptyIf.kt")
|
@TestMetadata("EmptyIf.kt")
|
||||||
public void testEmptyIf() throws Exception {
|
public void testEmptyIf() throws Exception {
|
||||||
|
|||||||
+6
@@ -8248,6 +8248,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("desugaredAssignment.kt")
|
||||||
|
public void testDesugaredAssignment() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/dataFlow/desugaredAssignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("EmptyIf.kt")
|
@TestMetadata("EmptyIf.kt")
|
||||||
public void testEmptyIf() throws Exception {
|
public void testEmptyIf() throws Exception {
|
||||||
|
|||||||
+6
@@ -8254,6 +8254,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("desugaredAssignment.kt")
|
||||||
|
public void testDesugaredAssignment() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/dataFlow/desugaredAssignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("EmptyIf.kt")
|
@TestMetadata("EmptyIf.kt")
|
||||||
public void testEmptyIf() throws Exception {
|
public void testEmptyIf() throws Exception {
|
||||||
|
|||||||
@@ -82,6 +82,6 @@ fun FirElement.unwrapElement(): FirElement = when (this) {
|
|||||||
is FirSafeCallExpression -> selector.unwrapElement()
|
is FirSafeCallExpression -> selector.unwrapElement()
|
||||||
is FirCheckedSafeCallSubject -> originalReceiverRef.value.unwrapElement()
|
is FirCheckedSafeCallSubject -> originalReceiverRef.value.unwrapElement()
|
||||||
is FirCheckNotNullCall -> argument.unwrapElement()
|
is FirCheckNotNullCall -> argument.unwrapElement()
|
||||||
|
is FirDesugaredAssignmentValueReferenceExpression -> expressionRef.value.unwrapElement()
|
||||||
else -> this
|
else -> this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
package usage
|
||||||
|
|
||||||
|
class MyClass1
|
||||||
|
open class ABC {
|
||||||
|
open val nestedBlocks = ArrayList<MyClass1>()
|
||||||
|
|
||||||
|
fun makeInjectionBlocks() {
|
||||||
|
val l: List<Any> = listOf(1)
|
||||||
|
for (b in l) {
|
||||||
|
when (b) {
|
||||||
|
is Int -> <!ASSIGNMENT_TYPE_MISMATCH!><!VAL_REASSIGNMENT!>nestedBlocks<!> += b<!>
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
package usage
|
||||||
|
|
||||||
|
class MyClass1
|
||||||
|
open class ABC {
|
||||||
|
open val nestedBlocks = ArrayList<MyClass1>()
|
||||||
|
|
||||||
|
fun makeInjectionBlocks() {
|
||||||
|
val l: List<Any> = listOf(1)
|
||||||
|
for (b in l) {
|
||||||
|
when (b) {
|
||||||
|
is Int -> <!TYPE_MISMATCH!><!VAL_REASSIGNMENT!>nestedBlocks<!> += b<!>
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+6
@@ -8254,6 +8254,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
runTest("compiler/testData/diagnostics/tests/dataFlow/CalleeExpression.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("desugaredAssignment.kt")
|
||||||
|
public void testDesugaredAssignment() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/dataFlow/desugaredAssignment.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("EmptyIf.kt")
|
@TestMetadata("EmptyIf.kt")
|
||||||
public void testEmptyIf() throws Exception {
|
public void testEmptyIf() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user