FIR DFA: don't assume != true/false => == false/true

This also fixes some returnsNotNull contracts because the old code added
an implication that `== true` => `!= null` then promptly removed any
statement that this could've affected if the argument was a synthetic
variable.

^KT-26612 tag fixed-in-k2
This commit is contained in:
pyos
2022-11-10 17:42:08 +01:00
committed by teamcity
parent 98f52f13ef
commit 5b08c300f4
9 changed files with 47 additions and 106 deletions
@@ -66,7 +66,7 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) {
println(value_2)
}
null -> {
println(value_3?.xor(true))
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_3?.<!UNRESOLVED_REFERENCE!>xor<!>(true))
println(<!UNINITIALIZED_VARIABLE!>value_4<!>)
println(value_1)
println(value_2)
@@ -61,7 +61,7 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) {
println(value_2)
}
null -> {
<!OVERLOAD_RESOLUTION_AMBIGUITY!>println<!>(value_3?.<!UNRESOLVED_REFERENCE!>xor<!>(true))
println(value_3?.xor(true))
println(value_4)
println(value_1)
println(value_2)