K2: Fix inference from assignment in PCLA

Before this, the order of the constraints being added was incorrect

^KT-64222 Fixed
This commit is contained in:
Denis.Zharkov
2024-01-11 11:28:52 +01:00
committed by Space Team
parent 97d17012e5
commit 8f9c09482b
6 changed files with 21 additions and 35 deletions
@@ -46,23 +46,23 @@ fun main(arg: Any, condition: Boolean) {
val value2 = myBuilder {
accept("")
a = <!ASSIGNMENT_TYPE_MISMATCH!>45<!>
a = 45
when (condition) {
true -> a = <!ASSIGNMENT_TYPE_MISMATCH!>87<!>
false -> a = <!ASSIGNMENT_TYPE_MISMATCH!>65<!>
true -> a = 87
false -> a = 65
}
change {
a = <!ASSIGNMENT_TYPE_MISMATCH!>99<!>
a = 99
}
if (a is Int) {
a = <!ASSIGNMENT_TYPE_MISMATCH!>67<!>
a = 67
}
}
// See KT-54664
val value3 = myBuilder {
accept("")
a = <!ASSIGNMENT_TYPE_MISMATCH!>45<!>
a = 45
bar(::<!INAPPLICABLE_CANDIDATE!>a<!>)
}