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:
Svetlana Isakova
2014-12-15 22:54:52 +03:00
parent 8f6f404f14
commit bda5bab057
4 changed files with 55 additions and 20 deletions
@@ -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?>}
}
@@ -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