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/checksensible.check | |
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/checksensible.check')
-rw-r--r-- | test/files/neg/checksensible.check | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 0881205bb4..d785179a56 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -28,6 +28,9 @@ checksensible.scala:27: error: comparing values of types Int and Unit using `==' checksensible.scala:29: error: comparing values of types Int and String using `==' will always yield false 1 == "abc" ^ +checksensible.scala:33: error: comparing values of types Some[Int] and Int using `==' will always yield false + Some(1) == 1 // as above + ^ checksensible.scala:38: error: comparing a fresh object using `==' will always yield false new AnyRef == 1 ^ @@ -94,4 +97,4 @@ checksensible.scala:84: error: comparing values of types EqEqRefTest.this.C3 and checksensible.scala:95: error: comparing values of types Unit and Int using `!=' will always yield true while ((c = in.read) != -1) ^ -32 errors found +33 errors found |