[NI] Capture from supertypes of type parameter.

This works by accident in OI, so this should be supported by new inference.
This commit is contained in:
Stanislav Erokhin
2017-04-06 22:17:18 +03:00
parent c4ddc7a3a6
commit b4bf534d29
5 changed files with 69 additions and 4 deletions
@@ -0,0 +1,11 @@
interface Inv<T>
fun <Y: X, X : Inv<out String>> foo(x: X, y: Y) {
val rX = bar(x)
rX.length
val rY = bar(y)
rY.length
}
fun <Y> bar(<!UNUSED_PARAMETER!>l<!>: Inv<Y>): Y = TODO()
@@ -0,0 +1,10 @@
package
public fun </*0*/ Y> bar(/*0*/ l: Inv<Y>): Y
public fun </*0*/ Y : X, /*1*/ X : Inv<out kotlin.String>> foo(/*0*/ x: X, /*1*/ y: Y): kotlin.Unit
public interface Inv</*0*/ T> {
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
}