diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-22 23:45:15 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-22 23:45:15 -0700 |
commit | 2e7daa10097246c03df1f77aebc85f1ecdebb7e9 (patch) | |
tree | 002a9812d6104b98a99999d843b1f42114f2eb8e /test/files/pos | |
parent | ffd2602977ccbdea34f7c233299c89e1d9152c5d (diff) | |
parent | 17ed9675570487fc51b2b7be3efa7b4b99785a6c (diff) | |
download | scala-2e7daa10097246c03df1f77aebc85f1ecdebb7e9.tar.gz scala-2e7daa10097246c03df1f77aebc85f1ecdebb7e9.tar.bz2 scala-2e7daa10097246c03df1f77aebc85f1ecdebb7e9.zip |
Merge pull request #599 from som-snytt/ticket/5779-numeq-warn
SI-5779: Wrong warning message (comparing Number)
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t5779-numeq-warn.scala | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/pos/t5779-numeq-warn.scala b/test/files/pos/t5779-numeq-warn.scala new file mode 100644 index 0000000000..76ef2970fd --- /dev/null +++ b/test/files/pos/t5779-numeq-warn.scala @@ -0,0 +1,13 @@ + +object Test { + def main(args: Array[String]) { + val d: Double = (BigInt(1) << 64).toDouble + val f: Float = d.toFloat + val n: java.lang.Number = d.toFloat + assert (d == f) // ok + assert (d == n) // was: comparing values of types Double and Number using `==' will always yield false + assert (n == d) // was: Number and Double are unrelated: they will most likely never compare equal + assert (f == n) + assert (n == f) + } +} |