Test: arguments of type aliases should be substituted literally,

without type approximation.
TYPE_MISMATCH is an expected error.
This commit is contained in:
Dmitry Petrov
2016-06-10 12:17:53 +03:00
parent 7da50069eb
commit 1efbd34529
3 changed files with 18 additions and 0 deletions
@@ -0,0 +1,7 @@
typealias Array2D<T> = Array<Array<T>>
fun foo(a: Array2D<out Number>) = a
fun bar(a: Array2D<Int>) {
foo(<!TYPE_MISMATCH!>a<!>)
}
@@ -0,0 +1,5 @@
package
public typealias Array2D</*0*/ T> = kotlin.Array<kotlin.Array<T>>
public fun bar(/*0*/ a: Array2D<kotlin.Int> [= kotlin.Array<kotlin.Array<kotlin.Int>>]): kotlin.Unit
public fun foo(/*0*/ a: Array2D<out kotlin.Number> [= kotlin.Array<kotlin.Array<out kotlin.Number>>]): Array2D<out kotlin.Number> [= kotlin.Array<kotlin.Array<out kotlin.Number>>]