65c153a722
These should only have ever been necessary for field type inference in coroutines, which should have been fixed by0fc676a20c. Unlike903a5d69a4, this time the change is in an optimization pass. Advantage: optimization passes have a closer to the JVM view of the bytecode, which makes this change significantly more likely to be correct. Disadvantage: technically we don't really guarantee optimization passes other than FixStack will run at all. For KT-54581 this is 100% fine since the problem itself is caused by redundant checkcast elimination in the first place (otherwise there would've been a redundant cast to String), but for KT-53146 this means the fix is somewhat incidental and not necessarily guaranteed. ^KT-53146 Fixed ^KT-54581 Fixed
19 lines
230 B
Kotlin
Vendored
19 lines
230 B
Kotlin
Vendored
// 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
|