summaryrefslogtreecommitdiff
path: root/test/files/neg/t5426.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-31 08:21:34 -0800
committerPaul Phillips <paulp@improving.org>2012-01-31 08:51:42 -0800
commit147e9eaf3814738f339b020e701a160ba2f68b60 (patch)
treee76a078289a446c69e5c6f952e71e75033553ae6 /test/files/neg/t5426.check
parent263aa2ead1f599f48b218027eb9550745fef43f1 (diff)
downloadscala-147e9eaf3814738f339b020e701a160ba2f68b60.tar.gz
scala-147e9eaf3814738f339b020e701a160ba2f68b60.tar.bz2
scala-147e9eaf3814738f339b020e701a160ba2f68b60.zip
Improved warning for insensible comparisons.
Utilize knowledge of case class synthetic equals to rule out some comparisons statically. Closes SI-5426.
Diffstat (limited to 'test/files/neg/t5426.check')
-rw-r--r--test/files/neg/t5426.check13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/neg/t5426.check b/test/files/neg/t5426.check
new file mode 100644
index 0000000000..d9e192d3f0
--- /dev/null
+++ b/test/files/neg/t5426.check
@@ -0,0 +1,13 @@
+t5426.scala:2: error: comparing values of types Some[Int] and Int using `==' will always yield false
+ def f1 = Some(5) == 5
+ ^
+t5426.scala:3: error: comparing values of types Int and Some[Int] using `==' will always yield false
+ def f2 = 5 == Some(5)
+ ^
+t5426.scala:8: error: comparing values of types Int and Some[Int] using `==' will always yield false
+ (x1 == x2)
+ ^
+t5426.scala:9: error: comparing values of types Some[Int] and Int using `==' will always yield false
+ (x2 == x1)
+ ^
+four errors found