e8a640851a
Generate the expression with the original type and then insert an implicit conversion. That matches the behavior of psi2ir better and therefore avoids breaking backend assumptions. In particular, IrGetValue expects the type of the underlying symbol and the type of the IrGetValue to be the same.
29 lines
584 B
Kotlin
Vendored
29 lines
584 B
Kotlin
Vendored
// !LANGUAGE: -ProperIeee754Comparisons
|
|
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
|
|
|
fun box(): String {
|
|
val plusZero: Any = 0.0
|
|
val minusZero: Any = -0.0
|
|
if (plusZero is Double && minusZero is Double) {
|
|
when {
|
|
plusZero < minusZero -> {
|
|
return "fail 1"
|
|
}
|
|
|
|
plusZero > minusZero -> {}
|
|
else -> {
|
|
return "fail 2"
|
|
}
|
|
}
|
|
|
|
|
|
when {
|
|
plusZero == minusZero -> {
|
|
return "fail 3"
|
|
}
|
|
else -> {}
|
|
}
|
|
}
|
|
|
|
return "OK"
|
|
} |