Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/vararg/kt796_797.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

9 lines
264 B
Kotlin

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"
}