Skip to content

Commit 2065309

Browse files
author
Michael Bogdanov
committed
Test for KT-7338: Incorrect code is emitted for is-checks with array types, resulting in java.lang.VerifyError
#KT-7338 Obsolete
1 parent efd4a3c commit 2065309

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fun foo(x : Any): String {
2+
return if(x is Array<String>) x[0] else "fail"
3+
}
4+
5+
fun box(): String {
6+
return foo(array("OK"))
7+
}

compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithStdlibCodegenTestGenerated.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ public void testKt4357() throws Exception {
215215
doTestWithStdlib(fileName);
216216
}
217217

218+
@TestMetadata("kt7338.kt")
219+
public void testKt7338() throws Exception {
220+
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/arrays/kt7338.kt");
221+
doTestWithStdlib(fileName);
222+
}
223+
218224
@TestMetadata("kt945.kt")
219225
public void testKt945() throws Exception {
220226
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/arrays/kt945.kt");

0 commit comments

Comments
 (0)