Revert "KT-53146 Don't coerce Nothing? returned from "catch" clauses"

This reverts commit 903a5d69a4.
This commit is contained in:
Pavel Mikhailovskii
2022-10-10 13:36:44 +02:00
parent 8eb0ca705d
commit 5fdfd4a421
4 changed files with 1 additions and 33 deletions
@@ -4787,12 +4787,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
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
@TestMetadata("kt53677.kt")
public void testKt53677() throws Exception {
@@ -1225,9 +1225,7 @@ class ExpressionCodegen(
val catchResult = catchBody.accept(this, catchBlockInfo)
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)
} else {
catchResult.discard()
-18
View File
@@ -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
@@ -4787,12 +4787,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
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
@TestMetadata("kt53677.kt")
public void testKt53677() throws Exception {