Captured type might be substituted in an opposite projection
out Captured (in Int) = out Int in Captured (out Int) = in Int
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun <T> foo1(a1: Array<in T>, a2: Array<T>): T = null!!
|
||||
|
||||
fun test1(a1: Array<Int>, a2: Array<out Int>) {
|
||||
foo1(a1, a2) checkType { it : _<Int> }
|
||||
}
|
||||
|
||||
fun <T> foo2(a1: Array<T>, a2: Array<out T>): T = null!!
|
||||
|
||||
fun test2(a1: Array<in Int>, a2: Array<Int>) {
|
||||
foo2(a1, a2) checkType { it : _<Any?>}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package
|
||||
|
||||
internal fun </*0*/ T> foo1(/*0*/ a1: kotlin.Array<in T>, /*1*/ a2: kotlin.Array<T>): T
|
||||
internal fun </*0*/ T> foo2(/*0*/ a1: kotlin.Array<T>, /*1*/ a2: kotlin.Array<out T>): T
|
||||
internal fun test1(/*0*/ a1: kotlin.Array<kotlin.Int>, /*1*/ a2: kotlin.Array<out kotlin.Int>): kotlin.Unit
|
||||
internal fun test2(/*0*/ a1: kotlin.Array<in kotlin.Int>, /*1*/ a2: kotlin.Array<kotlin.Int>): kotlin.Unit
|
||||
Reference in New Issue
Block a user