[FIR] Fix clearing info about DF variable after reassignment
This commit is contained in:
+5
@@ -3141,6 +3141,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/boundSafeCallAndIsCheck.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("complexIfWithOr.kt")
|
||||
public void testComplexIfWithOr() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/complexIfWithOr.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("safeCallAndEqualityToBool.kt")
|
||||
public void testSafeCallAndEqualityToBool() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt");
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
FILE: complexIfWithOr.kt
|
||||
public abstract interface State : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface Complex : R|kotlin/Any| {
|
||||
public abstract val superClass: R|Complex?|
|
||||
public get(): R|Complex?|
|
||||
|
||||
}
|
||||
public abstract interface ExceptionState : R|State| {
|
||||
}
|
||||
public final fun test(qualifier: R|State?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
==(R|<local>/qualifier|, Null(null)) || (R|<local>/qualifier| is R|ExceptionState|) || ==((R|<local>/qualifier| as? R|Complex|)?.{ $subj$.R|/Complex.superClass| }, Null(null)) -> {
|
||||
^test Unit
|
||||
}
|
||||
}
|
||||
|
||||
R|<local>/qualifier|.R|/Complex.superClass|
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
interface State
|
||||
interface Complex {
|
||||
val superClass: Complex?
|
||||
}
|
||||
|
||||
interface ExceptionState : State
|
||||
|
||||
fun test(qualifier: State?) {
|
||||
if (qualifier == null || qualifier is ExceptionState || (qualifier as? Complex)?.superClass == null) {
|
||||
return
|
||||
}
|
||||
qualifier.superClass
|
||||
}
|
||||
+6
@@ -3520,6 +3520,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/boundSafeCallAndIsCheck.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("complexIfWithOr.kt")
|
||||
public void testComplexIfWithOr() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/complexIfWithOr.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("safeCallAndEqualityToBool.kt")
|
||||
public void testSafeCallAndEqualityToBool() throws Exception {
|
||||
|
||||
+6
@@ -3566,6 +3566,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/boundSafeCallAndIsCheck.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("complexIfWithOr.kt")
|
||||
public void testComplexIfWithOr() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/complexIfWithOr.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("safeCallAndEqualityToBool.kt")
|
||||
public void testSafeCallAndEqualityToBool() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user