[JVM IR] Do not insert Nothing handling in JvmStatic wrapper.

Fixes KT-46568.
This commit is contained in:
Mads Ager
2021-05-10 13:07:34 +02:00
committed by Alexander Udalov
parent 3532ce7fbc
commit 3db5ba98ad
10 changed files with 62 additions and 0 deletions
@@ -24232,6 +24232,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/jvmStatic/kt45408.kt");
}
@Test
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@Test
@TestMetadata("kt9897_static.kt")
public void testKt9897_static() throws Exception {
@@ -144,6 +144,7 @@ private fun IrFunction.isStaticInlineClassReplacementDelegatingCall(): Boolean =
private val BRIDGE_ORIGINS = setOf(
IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER,
JvmLoweredDeclarationOrigin.JVM_STATIC_WRAPPER,
JvmLoweredDeclarationOrigin.JVM_OVERLOADS_WRAPPER,
JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR,
JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR_FOR_HIDDEN_CONSTRUCTOR,
+18
View File
@@ -0,0 +1,18 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
abstract class Foo {
companion object {
@JvmStatic
fun bar(): Nothing = TODO()
}
}
fun box(): String {
try {
Foo.bar()
} catch (e: Throwable) {
return "OK"
}
return "FAIL"
}
@@ -24208,6 +24208,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/jvmStatic/kt45408.kt");
}
@Test
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@Test
@TestMetadata("kt9897_static.kt")
public void testKt9897_static() throws Exception {
@@ -24232,6 +24232,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/jvmStatic/kt45408.kt");
}
@Test
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@Test
@TestMetadata("kt9897_static.kt")
public void testKt9897_static() throws Exception {
@@ -20406,6 +20406,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/jvmStatic/kt45408.kt");
}
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@TestMetadata("kt9897_static.kt")
public void testKt9897_static() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt9897_static.kt");
@@ -15960,6 +15960,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -15371,6 +15371,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -15436,6 +15436,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -9181,6 +9181,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("kt46568.kt")
public void testKt46568() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt46568.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)