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
@@ -2,6 +2,6 @@ fun <T> f(): T? = "OK" as? T
fun g(): Nothing = throw RuntimeException("fail")
fun <T : Any> h(): T = run { f() } ?: run { g() }
fun <T : Any> h(): T = run<T?> { f() } ?: run { g() }
fun box(): String = h<String>()