[NI] Support fixation to subtype in completion mode calculator

Allow full compltion mode for return type depending on type parameters in
contravariant position only if they have proper equality constraint.
This commit is contained in:
Pavel Kirpichenkov
2019-12-19 13:56:53 +03:00
parent e69e45e2a6
commit 384bd858e9
12 changed files with 178 additions and 13 deletions
@@ -0,0 +1,15 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
interface Bound
interface Upper : Bound
class Lower : Upper
class Inv<T>
fun <T : Bound, U : T> makeInv(v: U): Inv<T> = TODO()
fun <K> id(arg: K): K = arg
fun test(lower: Lower) {
id<Inv<Upper>>(makeInv(lower))
}