diff --git a/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt b/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt index af22c1a20bd..406b97e57a4 100644 --- a/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt +++ b/compiler/testData/codegen/box/arrays/arrayInstanceOf.kt @@ -22,5 +22,8 @@ fun test(createIntNotLong: Boolean): String { } fun box(): String { + // Only run this test if primitive array `is` checks work (KT-17137) + if ((intArrayOf() as Any) is Array<*>) return "OK" + return test(true) + test(false) } \ No newline at end of file diff --git a/compiler/testData/codegen/box/arrays/kt2997.kt b/compiler/testData/codegen/box/arrays/kt2997.kt index f42acc4a2e9..ac70c009a2d 100644 --- a/compiler/testData/codegen/box/arrays/kt2997.kt +++ b/compiler/testData/codegen/box/arrays/kt2997.kt @@ -53,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) diff --git a/compiler/testData/codegen/box/arrays/kt7288.kt b/compiler/testData/codegen/box/arrays/kt7288.kt index 12cd2e6c591..2c387e56cf9 100644 --- a/compiler/testData/codegen/box/arrays/kt7288.kt +++ b/compiler/testData/codegen/box/arrays/kt7288.kt @@ -21,6 +21,9 @@ fun test(b: Boolean): String { } fun box(): String { + // Only run this test if primitive array `is` checks work (KT-17137) + if ((intArrayOf() as Any) is Array<*>) return "OK" + if (test(true) != "OK") return "fail 1: ${test(true)}" if (test(false) != "OK") return "fail 1: ${test(false)}" diff --git a/compiler/testData/codegen/box/ranges/forInIndices/kt13241_Array.kt b/compiler/testData/codegen/box/ranges/forInIndices/kt13241_Array.kt index fdabe3cc1e6..47b299b9a5c 100644 --- a/compiler/testData/codegen/box/ranges/forInIndices/kt13241_Array.kt +++ b/compiler/testData/codegen/box/ranges/forInIndices/kt13241_Array.kt @@ -13,6 +13,9 @@ fun test(x: 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" + assertEquals(123, test(intArrayOf(0, 0, 0, 0))) return "OK" } \ No newline at end of file diff --git a/libraries/stdlib/test/collections/ArraysTest.kt b/libraries/stdlib/test/collections/ArraysTest.kt index 01a50b04537..5ec2bee5f7c 100644 --- a/libraries/stdlib/test/collections/ArraysTest.kt +++ b/libraries/stdlib/test/collections/ArraysTest.kt @@ -231,6 +231,12 @@ class ArraysTest { } @Test fun contentDeepToString() { + // Don't run this test unless primitive array `is` checks are supported (KT-17137) + if ((intArrayOf() as Any) is Array<*>) { + assertTrue(true) + return + } + val arr = arrayOf("aa", 1, null, charArrayOf('d')) assertEquals("[aa, 1, null, [d]]", arr.contentDeepToString()) }