[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:
Vendored
+11
@@ -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()
|
||||
Vendored
+10
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user