[NI] Add constrains even we try add constraint like TypeVariable <: CapturedType from subtyping.

If such captured type has lower type, then from TypeVariable <: lowerType => TypeVariable <: CapturedType.
This commit is contained in:
Stanislav Erokhin
2017-04-07 13:24:34 +03:00
parent 657c332a1f
commit 53caa84db9
6 changed files with 67 additions and 34 deletions
@@ -0,0 +1,9 @@
fun <V, R, M : MutableMap<in R, out V>> mapKeysTo(destination: M): Inv3<R, V, M> {
val foo = associateByTo(destination)
return foo
}
fun < Y, Z, T : MutableMap<in Y, out Z>> associateByTo(<!UNUSED_PARAMETER!>destination<!>: T): Inv3<Y, Z, T> = TODO()
interface Inv3<A, B, C>
@@ -0,0 +1,10 @@
package
public fun </*0*/ Y, /*1*/ Z, /*2*/ T : kotlin.collections.MutableMap<in Y, out Z>> associateByTo(/*0*/ destination: T): Inv3<Y, Z, T>
public fun </*0*/ V, /*1*/ R, /*2*/ M : kotlin.collections.MutableMap<in R, out V>> mapKeysTo(/*0*/ destination: M): Inv3<R, V, M>
public interface Inv3</*0*/ A, /*1*/ B, /*2*/ C> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}