KT-53465, KT-53677 Get rid of unnecessary checkcasts to array of reified type

This commit is contained in:
Pavel Mikhailovskii
2022-09-06 11:12:42 +02:00
committed by teamcity
parent d8522a8967
commit a75d5ba4cf
17 changed files with 213 additions and 1 deletions
@@ -4517,6 +4517,24 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/casts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("arrayDowncastingContravariant.kt")
public void testArrayDowncastingContravariant() throws Exception {
runTest("compiler/testData/codegen/box/casts/arrayDowncastingContravariant.kt");
}
@Test
@TestMetadata("arrayDowncatingInvariant.kt")
public void testArrayDowncatingInvariant() throws Exception {
runTest("compiler/testData/codegen/box/casts/arrayDowncatingInvariant.kt");
}
@Test
@TestMetadata("arrayDownctingCovariant.kt")
public void testArrayDownctingCovariant() throws Exception {
runTest("compiler/testData/codegen/box/casts/arrayDownctingCovariant.kt");
}
@Test
@TestMetadata("as.kt")
public void testAs() throws Exception {
@@ -4631,6 +4631,24 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/casts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("arrayDowncastingContravariant.kt")
public void testArrayDowncastingContravariant() throws Exception {
runTest("compiler/testData/codegen/box/casts/arrayDowncastingContravariant.kt");
}
@Test
@TestMetadata("arrayDowncatingInvariant.kt")
public void testArrayDowncatingInvariant() throws Exception {
runTest("compiler/testData/codegen/box/casts/arrayDowncatingInvariant.kt");
}
@Test
@TestMetadata("arrayDownctingCovariant.kt")
public void testArrayDownctingCovariant() throws Exception {
runTest("compiler/testData/codegen/box/casts/arrayDownctingCovariant.kt");
}
@Test
@TestMetadata("as.kt")
public void testAs() throws Exception {
@@ -4757,6 +4775,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/casts/kt50577.kt");
}
@Test
@TestMetadata("kt53677.kt")
public void testKt53677() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt53677.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
@@ -1092,6 +1092,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
runTest("compiler/testData/codegen/bytecodeText/checkcast/kt22714.kt");
}
@Test
@TestMetadata("kt53465.kt")
public void testKt53465() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/checkcast/kt53465.kt");
}
@Test
@TestMetadata("noCheckcastOnDelegatingDefaultImplsCall.kt")
public void testNoCheckcastOnDelegatingDefaultImplsCall() throws Exception {