[FIR2IR] Add Unit coercion for non-last expressions in try/catch blocks
^KT-61088 Fixed
This commit is contained in:
committed by
Space Team
parent
3d66511ca7
commit
88b80e0ed2
@@ -6,13 +6,18 @@ import java.lang.invoke.MethodHandles
|
||||
import java.lang.invoke.MethodType
|
||||
|
||||
object O {
|
||||
fun main() {}
|
||||
var counter = 0
|
||||
fun main() {
|
||||
counter += 1
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
val mh = MethodHandles.lookup().findVirtual(O::class.java, "main", MethodType.methodType(Void.TYPE))
|
||||
mh.invokeExact(O)
|
||||
mh.invokeExact(O)
|
||||
} finally {}
|
||||
if (O.counter != 2) return "Fail: counter == ${O.counter}"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
// !LANGUAGE: +PolymorphicSignature
|
||||
// IGNORE_BACKEND_K2: JVM_IR, JS_IR
|
||||
// FIR status: Fail 9
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// SKIP_JDK6
|
||||
|
||||
Reference in New Issue
Block a user