JVM_IR KT-27427 use checkNotNull with message in checked casts

This would prevent extra branching in 'as <not-null-type>', which
usually would not be covered.
This commit is contained in:
Dmitry Petrov
2021-12-29 20:11:12 +03:00
committed by teamcity
parent 9132c9b2d0
commit 1e5fc1c3aa
11 changed files with 175 additions and 79 deletions
@@ -5356,6 +5356,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
runTest("compiler/testData/codegen/bytecodeText/temporaryVals/elvisChain.kt");
}
@Test
@TestMetadata("noTemporaryInCheckedCast.kt")
public void testNoTemporaryInCheckedCast() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/temporaryVals/noTemporaryInCheckedCast.kt");
}
@Test
@TestMetadata("notNullReceiversInChain.kt")
public void testNotNullReceiversInChain() throws Exception {
@@ -5506,6 +5506,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
runTest("compiler/testData/codegen/bytecodeText/temporaryVals/elvisChain.kt");
}
@Test
@TestMetadata("noTemporaryInCheckedCast.kt")
public void testNoTemporaryInCheckedCast() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/temporaryVals/noTemporaryInCheckedCast.kt");
}
@Test
@TestMetadata("notNullReceiversInChain.kt")
public void testNotNullReceiversInChain() throws Exception {