JVM: correctly merge typed null values

1. merge(null of type A, null of type B) = null of unknown type;
2. merge(null of type A, something of type B) = merge(unknown null, B).

^KT-52311 Fixed
This commit is contained in:
pyos
2022-05-10 15:29:51 +02:00
committed by teamcity
parent dcdd1cd14e
commit 513ef575ce
11 changed files with 160 additions and 2 deletions
@@ -7181,6 +7181,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/kt51718.kt");
}
@Test
@TestMetadata("kt52311_nullOnLeft.kt")
public void testKt52311_nullOnLeft() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnLeft.kt");
}
@Test
@TestMetadata("kt52311_nullOnRight.kt")
public void testKt52311_nullOnRight() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
@@ -7223,6 +7223,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/coroutines/kt51718.kt");
}
@Test
@TestMetadata("kt52311_nullOnLeft.kt")
public void testKt52311_nullOnLeft() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnLeft.kt");
}
@Test
@TestMetadata("kt52311_nullOnRight.kt")
public void testKt52311_nullOnRight() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@Test
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
@@ -6354,6 +6354,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/coroutines/kt51718.kt");
}
@TestMetadata("kt52311_nullOnLeft.kt")
public void testKt52311_nullOnLeft() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnLeft.kt");
}
@TestMetadata("kt52311_nullOnRight.kt")
public void testKt52311_nullOnRight() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/kt52311_nullOnRight.kt");
}
@TestMetadata("lastExpressionIsLoop.kt")
public void testLastExpressionIsLoop() throws Exception {
runTest("compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt");