FIR: Change the Fir2Ir handling of smart casts.
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.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
// FIR inserts incorrect smart casts based on the cast in the
|
||||
// lambda. However, that cast can fail and the failure can be caught
|
||||
// by the inline function.
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// TODO: muted automatically, investigate should it be ran for JS or not
|
||||
// IGNORE_BACKEND: JS, NATIVE
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: -ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
||||
|
||||
fun greater1(a: Double, b: Double) = a > b
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: -ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
||||
|
||||
fun greater1(a: Float, b: Float) = a > b
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: -ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
||||
|
||||
fun less1(a: Double, b: Double) = a < b
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: -ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
||||
|
||||
fun less1(a: Float, b: Float) = a < b
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: -ProperIeee754Comparisons
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// DONT_TARGET_EXACT_BACKEND: JS_IR
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Reference in New Issue
Block a user