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
@@ -27,14 +27,14 @@ fun test() {
var variable = getTypeVariable()
variable = TargetType()
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
variable = <!ASSIGNMENT_TYPE_MISMATCH!>DifferentType()<!>
variable = DifferentType()
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
variable = TargetType()
variable.<!UNRESOLVED_REFERENCE!>targetTypeMemberFunction<!>()
}
// exact type equality check — turns unexpected compile-time behavior into red code
// considered to be non-user-reproducible code for the purposes of these tests
checkExactType<Buildee<Any>>(<!ARGUMENT_TYPE_MISMATCH!>anyBuildee<!>)
checkExactType<Buildee<Any>>(anyBuildee)
}
@@ -1,16 +0,0 @@
// ISSUE: KT-64222
interface A {
fun bar(): B<Int>
}
interface B<T>
fun <E> foo(block: B<E>.() -> Unit): B<E> = TODO()
class C : A {
private var value: B<Int>? = null
override fun <!RETURN_TYPE_MISMATCH_ON_OVERRIDE!>bar<!>() = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!> {
value = this
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// ISSUE: KT-64222
interface A {