Revert "KT-53146 Don't coerce Nothing? returned from "catch" clauses"
This reverts commit 903a5d69a4.
This commit is contained in:
-6
@@ -4787,12 +4787,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/casts/kt50577.kt");
|
runTest("compiler/testData/codegen/box/casts/kt50577.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt53146.kt")
|
|
||||||
public void testKt53146() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/casts/kt53146.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt53677.kt")
|
@TestMetadata("kt53677.kt")
|
||||||
public void testKt53677() throws Exception {
|
public void testKt53677() throws Exception {
|
||||||
|
|||||||
+1
-3
@@ -1225,9 +1225,7 @@ class ExpressionCodegen(
|
|||||||
|
|
||||||
val catchResult = catchBody.accept(this, catchBlockInfo)
|
val catchResult = catchBody.accept(this, catchBlockInfo)
|
||||||
if (savedValue != null) {
|
if (savedValue != null) {
|
||||||
if (catchResult.irType != context.irBuiltIns.nothingNType) {
|
catchResult.materializeAt(tryAsmType, aTry.type, true)
|
||||||
catchResult.materializeAt(tryAsmType, aTry.type, true)
|
|
||||||
}
|
|
||||||
mv.store(savedValue, tryAsmType)
|
mv.store(savedValue, tryAsmType)
|
||||||
} else {
|
} else {
|
||||||
catchResult.discard()
|
catchResult.discard()
|
||||||
|
|||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
// TARGET_BACKEND: JVM_IR
|
|
||||||
// WITH_STDLIB
|
|
||||||
// FULL_JDK
|
|
||||||
// CHECK_BYTECODE_TEXT
|
|
||||||
|
|
||||||
class A
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
val a = try {
|
|
||||||
A()
|
|
||||||
} catch (e: NoClassDefFoundError) {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 0 CHECKCAST
|
|
||||||
-6
@@ -4787,12 +4787,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/casts/kt50577.kt");
|
runTest("compiler/testData/codegen/box/casts/kt50577.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt53146.kt")
|
|
||||||
public void testKt53146() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/casts/kt53146.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt53677.kt")
|
@TestMetadata("kt53677.kt")
|
||||||
public void testKt53677() throws Exception {
|
public void testKt53677() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user