JVM_IR: add a test for when(enum) binary compatibility

This commit is contained in:
pyos
2022-04-06 13:10:12 +02:00
committed by Alexander Udalov
parent 518a6dec8c
commit d61e7db937
5 changed files with 38 additions and 0 deletions
@@ -0,0 +1,18 @@
import test.*
fun f1(x: E1) = when (x) {
E1.A -> "A"
E1.B -> "B"
E1.C -> "C"
}
fun f2(x: E2) = when (x) {
E2.A -> "A"
E2.B -> "B"
E2.C -> "C"
}
fun run(): String {
val c2 = try { f2(E2.C) } catch (e: java.lang.NoSuchFieldError) { "" }
return f1(E1.A) + f1(E1.B) + f1(E1.C) + f2(E2.A) + f2(E2.B) + c2
}