From 20653090d3878f98aba4e02201317c2c60f29eac Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Thu, 9 Apr 2015 11:10:33 +0300 Subject: [PATCH] Test for KT-7338: Incorrect code is emitted for is-checks with array types, resulting in java.lang.VerifyError #KT-7338 Obsolete --- compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt | 7 +++++++ .../generated/BlackBoxWithStdlibCodegenTestGenerated.java | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt diff --git a/compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt b/compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt new file mode 100644 index 00000000000..1762a9d516f --- /dev/null +++ b/compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt @@ -0,0 +1,7 @@ +fun foo(x : Any): String { + return if(x is Array) x[0] else "fail" +} + +fun box(): String { + return foo(array("OK")) +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java index f1e5a011fcd..0b5b32da0c5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java @@ -215,6 +215,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } + @TestMetadata("kt7338.kt") + public void testKt7338() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt"); + doTestWithStdlib(fileName); + } + @TestMetadata("kt945.kt") public void testKt945() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/arrays/kt945.kt");