Don't fix a type variable into the intersection type if there is an explicit expected type

^KT-43303 Fixed
^KT-42396 Fixed
^KT-42472 Fixed
This commit is contained in:
Victor Petukhov
2021-03-03 16:02:10 +03:00
parent e06bacafad
commit 7f7bb70596
18 changed files with 220 additions and 6 deletions
@@ -12,7 +12,7 @@ fun test(x: X<Number>) {
fun <S, D: S> g() {
fun <T : S> foo(): T = TODO()
val <!UNUSED_VARIABLE!>y<!> = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED{OI}!>foo<!>() as Int
val <!UNUSED_VARIABLE!>y<!> = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED{OI}, TYPE_MISMATCH!>foo<!>() as Int
val <!UNUSED_VARIABLE!>y2<!> = foo() as D
}