Files
kotlin-fork/compiler/testData/codegen/box/vararg/kt796_797.kt
T
2018-06-09 19:15:38 +03:00

10 lines
289 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
operator fun <T> Array<T>?.get(i : Int?) = this!!.get(i!!)
fun <T> array(vararg t : T) : Array<T> = t as Array<T>
fun box() : String {
val a : Array<String>? = array<String>("Str", "Str2")
val i : Int? = 1
return if(a[i] == "Str2") "OK" else "fail"
}