Files
kotlin/compiler/testData/codegen/box/binaryOp/eqNullableDoublesToIntWithTP.kt
Mikhail Glukhikh 8c21f04bf4 FIR2IR: determine type parameters before value parameters
Type parameters can be referred from value parameters,
so we should determine them earlier to be able to set their indexes
2020-02-20 18:34:51 +03:00

21 lines
790 B
Kotlin
Vendored

// !LANGUAGE: +ProperIeee754Comparisons
// It doesn't work on JS due to how numbers are represented, but it could be changed in the future.
// IGNORE_BACKEND: JS
// IGNORE_BACKEND: JS_IR
fun <A: Double, B: Any> eq_double_any(a: A, b: B) = a == b
fun <A: Double, B: Any?> eq_double_anyN(a: A, b: B) = a == b
fun <A: Double?, B: Any> eq_doubleN_any(a: A, b: B) = a == b
fun <A: Double?, B: Any?> eq_doubleN_anyN(a: A, b: B) = a == b
fun box(): String {
if (eq_double_any(0.0, 0)) throw AssertionError("eq_double_any(0.0, 0)")
if (eq_double_anyN(0.0, 0)) throw AssertionError("eq_double_anyN(0.0, 0)")
if (eq_doubleN_any(0.0, 0)) throw AssertionError("eq_doubleN_any(0.0, 0)")
if (eq_doubleN_anyN(0.0, 0)) throw AssertionError("eq_doubleN_anyN(0.0, 0)")
return "OK"
}