JS: make tests dependent on primitive array is checks pass even when -Xtypedarray is disabled (related: KT-17137)

This commit is contained in:
Anton Bannykh
2017-03-28 14:52:03 +03:00
parent 7d4c26c0c1
commit 867bd13ce4
6 changed files with 54 additions and 49 deletions
+3 -2
View File
@@ -1,6 +1,4 @@
//KT-2997 Automatically cast error (Array)
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// Unmute when JS implements primitive arrays via TypedArray
fun foo(a: Any): Int {
if (a is IntArray) {
@@ -55,6 +53,9 @@ fun foo(a: Any): Int {
}
fun box(): String {
// Only run this test if primitive array `is` checks work (KT-17137)
if ((intArrayOf() as Any) is Array<*>) return "OK"
val iA = IntArray(1)
if (foo(iA) != 1) return "fail int[]"
val sA = ShortArray(1)