Implement special desugaring for numeric comparisons in PSI2IR

This introduces the following IR built-in functions required for proper
implementation of the number comparisons:

- ieee754Equals(T, T): Boolean,
    for each T in {Float?, Double?}

- less(T, T): Boolean
  lessOrEqual(T, T): Boolean
  greater(T, T): Boolean
  greaterOrEqual(T, T): Boolean
    for each T in {Int, Long, Float, Double}
This commit is contained in:
Dmitry Petrov
2018-02-01 16:18:01 +03:00
parent f4ed4ec9d9
commit 9137e68d4e
33 changed files with 1566 additions and 233 deletions
@@ -0,0 +1,3 @@
fun testD(x: Comparable<Double>, y: Comparable<Double>) = x is Double && y is Double && x < y
fun testF(x: Comparable<Float>, y: Comparable<Float>) = x is Float && y is Float && x < y
@@ -0,0 +1,49 @@
FILE fqName:<root> fileName:/comparableWithDoubleOrFloat.kt
FUN name:testD visibility:public modality:FINAL <> (x:kotlin.Comparable<kotlin.Double>, y:kotlin.Comparable<kotlin.Double>) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Comparable<kotlin.Double> flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Comparable<kotlin.Double> flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testD(Comparable<Double>, Comparable<Double>): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Comparable<Double>' type=kotlin.Comparable<kotlin.Double> origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Comparable<Double>' type=kotlin.Comparable<kotlin.Double> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Comparable<Double>' type=kotlin.Comparable<kotlin.Double> origin=null
arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Comparable<Double>' type=kotlin.Comparable<kotlin.Double> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testF visibility:public modality:FINAL <> (x:kotlin.Comparable<kotlin.Float>, y:kotlin.Comparable<kotlin.Float>) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Comparable<kotlin.Float> flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Comparable<kotlin.Float> flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testF(Comparable<Float>, Comparable<Float>): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Comparable<Float>' type=kotlin.Comparable<kotlin.Float> origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Comparable<Float>' type=kotlin.Comparable<kotlin.Float> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'less(Float, Float): Boolean' type=kotlin.Boolean origin=LT
arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Comparable<Float>' type=kotlin.Comparable<kotlin.Float> origin=null
arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Comparable<Float>' type=kotlin.Comparable<kotlin.Float> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,14 @@
fun test1d(x: Double, y: Double) = x.compareTo(y)
fun test2d(x: Double, y: Any) = y is Double && x.compareTo(y) == 0
fun test3d(x: Any, y: Any) = x is Double && y is Double && x.compareTo(y) == 0
fun test1f(x: Float, y: Float) = x.compareTo(y)
fun test2f(x: Float, y: Any) = y is Float && x.compareTo(y) == 0
fun test3f(x: Any, y: Any) = x is Float && y is Float && x.compareTo(y) == 0
fun testFD(x: Any, y: Any) = x is Float && y is Double && x.compareTo(y) == 0
fun testDF(x: Any, y: Any) = x is Double && y is Float && x.compareTo(y) == 0
fun Float.test1fr(x: Float) = compareTo(x)
fun Float.test2fr(x: Any) = x is Float && compareTo(x) == 0
fun Float.test3fr(x: Any) = x is Double && compareTo(x) == 0
@@ -0,0 +1,201 @@
FILE fqName:<root> fileName:/floatingPointCompareTo.kt
FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:Int flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1d(Double, Double): Int'
CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2d(Double, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3d(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:Int flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1f(Float, Float): Int'
CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Float' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2f(Float, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3f(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testFD(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:Int flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1fr(Float) on Float: Int'
CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'this@test1fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2fr(Any) on Float: Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Float): Int' type=kotlin.Int origin=null
$this: GET_VAR 'this@test2fr: Float' type=kotlin.Float origin=null
other: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3fr(Any) on Float: Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'compareTo(Double): Int' type=kotlin.Int origin=null
$this: GET_VAR 'this@test3fr: Float' type=kotlin.Float origin=null
other: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CONST Int type=kotlin.Int value=0
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,18 @@
fun test1d(x: Double, y: Double) = x == y
fun test2d(x: Double, y: Double?) = x == y
fun test3d(x: Double, y: Any) = x == y
fun test4d(x: Double, y: Number) = x == y
fun test5d(x: Double, y: Any) = y is Double && x == y
fun test6d(x: Any, y: Any) = x is Double && y is Double && x == y
fun test1f(x: Float, y: Float) = x == y
fun test2f(x: Float, y: Float?) = x == y
fun test3f(x: Float, y: Any) = x == y
fun test4f(x: Float, y: Number) = x == y
fun test5f(x: Float, y: Any) = y is Float && x == y
fun test6f(x: Any, y: Any) = x is Float && y is Float && x == y
// The following possibly should not compile (but so far it does)
// because of EQUALITY_NOT_APPLICABLE.
fun testFD(x: Any, y: Any) = x is Float && y is Double && x == y
fun testDF(x: Any, y: Any) = x is Double && y is Float && x == y
@@ -0,0 +1,195 @@
FILE fqName:<root> fileName:/floatingPointEqeq.kt
FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1d(Double, Double): Boolean'
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2d(Double, Double?): Boolean'
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Double?' type=kotlin.Double? origin=null
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3d(Double, Any): Boolean'
CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4d(Double, Number): Boolean'
CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Number' type=kotlin.Number origin=null
FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5d(Double, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6d(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1f(Float, Float): Boolean'
CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Float' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2f(Float, Float?): Boolean'
CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Float?' type=kotlin.Float? origin=null
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3f(Float, Any): Boolean'
CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4f(Float, Number): Boolean'
CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Number' type=kotlin.Number origin=null
FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5f(Float, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6f(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float?
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testFD(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,23 @@
fun test1d(x: Double, y: Double) = x.equals(y)
fun test2d(x: Double, y: Double?) = x.equals(y)
fun test3d(x: Double, y: Any) = x.equals(y)
fun test4d(x: Double, y: Number) = x.equals(y)
fun test5d(x: Double, y: Any) = y is Double && x.equals(y)
fun test6d(x: Any, y: Any) = x is Double && y is Double && x.equals(y)
fun test1f(x: Float, y: Float) = x.equals(y)
fun test2f(x: Float, y: Float?) = x.equals(y)
fun test3f(x: Float, y: Any) = x.equals(y)
fun test4f(x: Float, y: Number) = x.equals(y)
fun test5f(x: Float, y: Any) = y is Float && x.equals(y)
fun test6f(x: Any, y: Any) = x is Float && y is Float && x.equals(y)
fun testFD(x: Any, y: Any) = x is Float && y is Double && x.equals(y)
fun testDF(x: Any, y: Any) = x is Double && y is Float && x.equals(y)
fun Float.test1fr(x: Float) = equals(x)
fun Float.test2fr(x: Float?) = equals(x)
fun Float.test3fr(x: Any) = equals(x)
fun Float.test4fr(x: Number) = equals(x)
fun Float.test5fr(x: Any) = x is Float && equals(x)
fun Float.test6fr(x: Any) = x is Double && equals(x)
@@ -0,0 +1,245 @@
FILE fqName:<root> fileName:/floatingPointEquals.kt
FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1d(Double, Double): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2d(Double, Double?): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Double?' type=kotlin.Double? origin=null
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3d(Double, Any): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4d(Double, Number): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Number' type=kotlin.Number origin=null
FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5d(Double, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6d(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1f(Float, Float): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Float' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2f(Float, Float?): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Float?' type=kotlin.Float? origin=null
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3f(Float, Any): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4f(Float, Number): Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Number' type=kotlin.Number origin=null
FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5f(Float, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6f(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testFD(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
other: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1fr(Float) on Float: Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'this@test1fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float?) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2fr(Float?) on Float: Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'this@test2fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Float?' type=kotlin.Float? origin=null
FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3fr(Any) on Float: Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'this@test3fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
FUN name:test4fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Number) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4fr(Number) on Float: Boolean'
CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'this@test4fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Number' type=kotlin.Number origin=null
FUN name:test5fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5fr(Any) on Float: Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'this@test5fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:Boolean flags:
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Float flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6fr(Any) on Float: Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: CALL 'equals(Any?): Boolean' type=kotlin.Boolean origin=null
$this: GET_VAR 'this@test6fr: Float' type=kotlin.Float origin=null
other: GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,18 @@
fun test1d(x: Double, y: Double) = x != y
fun test2d(x: Double, y: Double?) = x != y
fun test3d(x: Double, y: Any) = x != y
fun test4d(x: Double, y: Number) = x != y
fun test5d(x: Double, y: Any) = y is Double && x != y
fun test6d(x: Any, y: Any) = x is Double && y is Double && x != y
fun test1f(x: Float, y: Float) = x != y
fun test2f(x: Float, y: Float?) = x != y
fun test3f(x: Float, y: Any) = x != y
fun test4f(x: Float, y: Number) = x != y
fun test5f(x: Float, y: Any) = y is Float && x != y
fun test6f(x: Any, y: Any) = x is Float && y is Float && x != y
// The following possibly should not compile (but so far it does)
// because of EQUALITY_NOT_APPLICABLE.
fun testFD(x: Any, y: Any) = x is Float && y is Double && x != y
fun testDF(x: Any, y: Any) = x is Double && y is Float && x != y
@@ -0,0 +1,209 @@
FILE fqName:<root> fileName:/floatingPointExcleq.kt
FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1d(Double, Double): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2d(Double, Double?): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Double?' type=kotlin.Double? origin=null
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3d(Double, Any): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4d(Double, Number): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Number' type=kotlin.Number origin=null
FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5d(Double, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6d(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1f(Float, Float): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Float' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2f(Float, Float?): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Float?' type=kotlin.Float? origin=null
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3f(Float, Any): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Number flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test4f(Float, Number): Boolean'
CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'EQEQ(Any?, Any?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Number' type=kotlin.Number origin=null
FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test5f(Float, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test6f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test6f(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Float?, Float?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float?
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Float? origin=IMPLICIT_CAST typeOperand=kotlin.Float?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testFD(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'NOT(Boolean): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EXCLEQ
arg0: TYPE_OP type=kotlin.Double? origin=IMPLICIT_CAST typeOperand=kotlin.Double?
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,10 @@
fun test1d(x: Double, y: Double) = x < y
fun test2d(x: Double, y: Any) = y is Double && x < y
fun test3d(x: Any, y: Any) = x is Double && y is Double && x < y
fun test1f(x: Float, y: Float) = x < y
fun test2f(x: Float, y: Any) = y is Float && x < y
fun test3f(x: Any, y: Any) = x is Float && y is Float && x < y
fun testFD(x: Any, y: Any) = x is Float && y is Double && x < y
fun testDF(x: Any, y: Any) = x is Double && y is Float && x < y
@@ -0,0 +1,147 @@
FILE fqName:<root> fileName:/floatingPointLess.kt
FUN name:test1d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1d(Double, Double): Boolean'
CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2d(Double, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: GET_VAR 'value-parameter x: Double' type=kotlin.Double origin=null
arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3d(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test1f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Float flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test1f(Float, Float): Boolean'
CALL 'less(Float, Float): Boolean' type=kotlin.Boolean origin=LT
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: GET_VAR 'value-parameter y: Float' type=kotlin.Float origin=null
FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Float flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test2f(Float, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
then: CALL 'less(Float, Float): Boolean' type=kotlin.Boolean origin=LT
arg0: GET_VAR 'value-parameter x: Float' type=kotlin.Float origin=null
arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test3f(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'less(Float, Float): Boolean' type=kotlin.Boolean origin=LT
arg0: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testFD visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testFD(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Any, y:kotlin.Any) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Any, Any): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
then: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
then: CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: TYPE_OP type=kotlin.Double origin=IMPLICIT_CAST typeOperand=kotlin.Double
GET_VAR 'value-parameter x: Any' type=kotlin.Any origin=null
arg1: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any' type=kotlin.Any origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,2 @@
fun test(x: Any?, y: Double) =
x is Int && x < y
@@ -0,0 +1,18 @@
FILE fqName:<root> fileName:/nullableAnyAsIntToDouble.kt
FUN name:test visibility:public modality:FINAL <> (x:kotlin.Any?, y:kotlin.Double) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Any? flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='test(Any?, Double): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
then: CALL 'less(Double, Double): Boolean' type=kotlin.Boolean origin=LT
arg0: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
GET_VAR 'value-parameter x: Any?' type=kotlin.Any? origin=null
arg1: GET_VAR 'value-parameter y: Double' type=kotlin.Double origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
@@ -0,0 +1,3 @@
fun testDD(x: Double?, y: Double?) = x == y
fun testDF(x: Double?, y: Any?) = y is Float? && x == y
fun testDI(x: Double?, y: Any?) = y is Int? && x == y
@@ -0,0 +1,43 @@
FILE fqName:<root> fileName:/nullableFloatingPointEqeq.kt
FUN name:testDD visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Double?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double? flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Double? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDD(Double?, Double?): Boolean'
CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double?' type=kotlin.Double? origin=null
arg1: GET_VAR 'value-parameter y: Double?' type=kotlin.Double? origin=null
FUN name:testDF visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Any?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double? flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDF(Double?, Any?): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float?
GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null
then: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double?' type=kotlin.Double? origin=null
arg1: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Float origin=IMPLICIT_CAST typeOperand=kotlin.Float
GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false
FUN name:testDI visibility:public modality:FINAL <> (x:kotlin.Double?, y:kotlin.Any?) returnType:Boolean flags:
VALUE_PARAMETER name:x index:0 type:kotlin.Double? flags:
VALUE_PARAMETER name:y index:1 type:kotlin.Any? flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='testDI(Double?, Any?): Boolean'
WHEN type=kotlin.Boolean origin=ANDAND
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Int?
GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null
then: CALL 'ieee754equals(Double?, Double?): Boolean' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'value-parameter x: Double?' type=kotlin.Double? origin=null
arg1: CALL 'toDouble(): Double' type=kotlin.Double origin=null
$this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int
GET_VAR 'value-parameter y: Any?' type=kotlin.Any? origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Boolean type=kotlin.Boolean value=false