KT-9377 Support is-checks for read-only collections

Generate better code for 'as?' with mutable collection types:
use CHECKCAST, do not introduce special intrinsics for safe-as.
This commit is contained in:
Dmitry Petrov
2015-10-02 11:56:56 +03:00
parent e033d093d4
commit 06d9ff6a71
6 changed files with 46 additions and 125 deletions
@@ -239,6 +239,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("safeAsWithMutable.kt")
public void testSafeAsWithMutable() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/safeAsWithMutable.kt");
doTest(fileName);
}
@TestMetadata("topLevelFunWithDefaultArgs.kt")
public void testTopLevelFunWithDefaultArgs() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt");
@@ -529,6 +535,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("reifiedSafeAsWithMutable.kt")
public void testReifiedSafeAsWithMutable() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inline/reifiedSafeAsWithMutable.kt");
doTest(fileName);
}
@TestMetadata("removedFinallyMarkers.kt")
public void testRemovedFinallyMarkers() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inline/removedFinallyMarkers.kt");