Merge boxWithStdlib testData into box, delete BoxWithStdlib test
This commit is contained in:
committed by
Alexander Udalov
parent
22bfc9786a
commit
06a67e6602
@@ -0,0 +1,24 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
inline fun <reified T> foo(x: Any?) = Pair(x is T, x is T?)
|
||||
|
||||
fun box(): String {
|
||||
val x1 = foo<Array<String>>(arrayOf(""))
|
||||
if (x1.toString() != "(true, true)") return "fail 1"
|
||||
|
||||
val x2 = foo<Array<String>?>(arrayOf(""))
|
||||
if (x2.toString() != "(true, true)") return "fail 2"
|
||||
|
||||
val x3 = foo<Array<String>>(null)
|
||||
if (x3.toString() != "(false, true)") return "fail 3"
|
||||
|
||||
val x4 = foo<Array<String>?>(null)
|
||||
if (x4.toString() != "(true, true)") return "fail 4"
|
||||
|
||||
val x5 = foo<Array<Double>?>(arrayOf(""))
|
||||
if (x5.toString() != "(false, false)") return "fail 5"
|
||||
|
||||
val x6 = foo<Array<Double>?>(null)
|
||||
if (x6.toString() != "(true, true)") return "fail 6"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user