JVM_IR KT-43242 generate switch subject as primitive 'int'

This commit is contained in:
Dmitry Petrov
2020-11-19 12:08:48 +03:00
parent 05ddbeab0a
commit 118a7d4e34
6 changed files with 51 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
// TARGET_BACKEND: JVM
// FILE: kt43242.kt
fun fromJson() {
test = Bar().fromJson()?.let {
when (it) {
0 -> false
1 -> true
else -> true
}
}
}
var test: Any? = "xxx"
fun box(): String {
fromJson()
return if (test != null) "Fail: $test" else "OK"
}
// FILE: Bar.java
import org.jetbrains.annotations.Nullable;
public class Bar {
public final @Nullable Integer fromJson() {
return null;
}
}