Files
kotlin/compiler/testData/diagnostics/tests/jdk-annotations/ArrayListToArray.kt
Denis Zharkov 654411a0b0 Refactored tests using Array constructor:
Some moved to tests with stdlib
Some changed to use arrayOfNulls
2014-12-11 16:04:03 +03:00

14 lines
365 B
Kotlin

// !DIAGNOSTICS: -UNUSED_PARAMETER
package kotlin1
import java.util.*
public inline fun <reified T> Array(n: Int, block: (Int) -> T): Array<T> = null!!
fun main(args : Array<String>) {
val al : ArrayList<Int> = ArrayList<Int>()
// A type mismatch on this line means that jdk-annotations were not loaded
al.toArray(Array<Int>(3, {1})) : Array<Int>
}