diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-31 08:21:34 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-31 08:51:42 -0800 |
commit | 147e9eaf3814738f339b020e701a160ba2f68b60 (patch) | |
tree | e76a078289a446c69e5c6f952e71e75033553ae6 /test/files/neg/t5426.scala | |
parent | 263aa2ead1f599f48b218027eb9550745fef43f1 (diff) | |
download | scala-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.scala')
-rw-r--r-- | test/files/neg/t5426.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/t5426.scala b/test/files/neg/t5426.scala new file mode 100644 index 0000000000..f2fb5cc12c --- /dev/null +++ b/test/files/neg/t5426.scala @@ -0,0 +1,10 @@ +class A { + def f1 = Some(5) == 5 + def f2 = 5 == Some(5) + + val x1 = 5 + val x2 = Some(5) + + (x1 == x2) + (x2 == x1) +} |