[NI] Approximate captured types when we resolve type variable TO_SUPER.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
fun <S> Array<S>.plus(): Array<S> {
|
||||
val result = Arrays.copyOf(this, 3)
|
||||
// result type is Array<(out) (S&Any)!>!
|
||||
return result
|
||||
}
|
||||
|
||||
// FILE: Arrays.java
|
||||
public class Arrays {
|
||||
public static <T> T[] copyOf(T[] original, int newLength) {
|
||||
return (T[]) null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ S> kotlin.Array<S>.plus(): kotlin.Array<S>
|
||||
|
||||
public open class Arrays {
|
||||
public constructor Arrays()
|
||||
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
|
||||
|
||||
// Static members
|
||||
public open fun </*0*/ T : kotlin.Any!> copyOf(/*0*/ original: kotlin.Array<(out) T!>!, /*1*/ newLength: kotlin.Int): kotlin.Array<(out) T!>!
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fun <S : Any> foo(x: Array<out S?>, y: Array<in S?>) {
|
||||
val xo = outA(x)
|
||||
val yo = inA(y)
|
||||
|
||||
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>f<!>: Array<S> = xo
|
||||
<!UNUSED_VALUE!>f =<!> yo
|
||||
}
|
||||
|
||||
|
||||
fun <X : Any> outA(<!UNUSED_PARAMETER!>x<!>: Array<out X?>): Array<X> = TODO()
|
||||
fun <Y : Any> inA(<!UNUSED_PARAMETER!>x<!>: Array<in Y?>): Array<Y> = TODO()
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ S : kotlin.Any> foo(/*0*/ x: kotlin.Array<out S?>, /*1*/ y: kotlin.Array<in S?>): kotlin.Unit
|
||||
public fun </*0*/ Y : kotlin.Any> inA(/*0*/ x: kotlin.Array<in Y?>): kotlin.Array<Y>
|
||||
public fun </*0*/ X : kotlin.Any> outA(/*0*/ x: kotlin.Array<out X?>): kotlin.Array<X>
|
||||
Reference in New Issue
Block a user