JVM IR: fix incorrect type of IrCheckNotNull intrinsic
It is not correct to assume that arg0 has been generated to have the same IrType as the whole expression. The reason it only backfired in throwing exceptions probably has to do with the fact that visitThrow might be the only place in ExpressionCodegen right now which uses the IrType from PromisedValue to make a decision on whether to generate checkcast. It seems suspicious that ExpressionCodegen.visitFieldAccess/visitCall return PromisedValue whose IrType mentions type parameters which are declared outside of the call site, but that should probably be investigated separately. #KT-48440 Fixed
This commit is contained in:
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+10
@@ -11129,6 +11129,16 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/exclExcl/genericNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440.kt")
|
||||
public void testKt48440() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440_2.kt")
|
||||
public void testKt48440_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440_2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/primitive.kt");
|
||||
|
||||
Generated
+10
@@ -10535,6 +10535,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/genericNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440.kt")
|
||||
public void testKt48440() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440_2.kt")
|
||||
public void testKt48440_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440_2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/primitive.kt");
|
||||
|
||||
Generated
+10
@@ -10535,6 +10535,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/genericNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440.kt")
|
||||
public void testKt48440() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440_2.kt")
|
||||
public void testKt48440_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440_2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/primitive.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+10
@@ -5268,6 +5268,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/exclExcl"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440.kt")
|
||||
public void testKt48440() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt48440_2.kt")
|
||||
public void testKt48440_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/kt48440_2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitive.kt")
|
||||
public void testPrimitive() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/exclExcl/primitive.kt");
|
||||
|
||||
Reference in New Issue
Block a user