FIR DFA: check for reassignments of LHS when handling ?..
`x?.y != null` does not imply that `x != null` if e.g. an argument to `y` has reassigned `x` in the meantime. The same is true for `x == y` and `functionWithContract(x, y)`, but those are somewhat harder to implement since there is no easy way to find the last node of a certain argument. ^KT-55096
This commit is contained in:
+6
@@ -30643,6 +30643,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/smartCasts/variables/reassignedDependency.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reassignedInRhs.kt")
|
||||
public void testReassignedInRhs() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/smartCasts/variables/reassignedInRhs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("varAsUse.kt")
|
||||
public void testVarAsUse() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user