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:
@@ -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>()
|
||||
|
||||
Reference in New Issue
Block a user