diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/checksensible.check | 42 | ||||
-rw-r--r-- | test/files/neg/checksensible.scala | 8 |
2 files changed, 27 insertions, 23 deletions
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index b36b11bf98..67a76dd7be 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -28,64 +28,64 @@ checksensible.scala:27: error: comparing values of types Int and Unit using `==' checksensible.scala:29: error: comparing values of types Int and java.lang.String using `==' will always yield false 1 == "abc" ^ -checksensible.scala:32: error: comparing a fresh object using `==' will always yield false +checksensible.scala:34: error: comparing a fresh object using `==' will always yield false new AnyRef == 1 ^ -checksensible.scala:33: error: comparing values of types Int and java.lang.Object using `==' will always yield false - 1 == new AnyRef +checksensible.scala:37: error: comparing values of types Int and java.lang.Boolean using `==' will always yield false + 1 == (new java.lang.Boolean(true)) ^ -checksensible.scala:35: error: comparing values of types Int and Boolean using `!=' will always yield true +checksensible.scala:39: error: comparing values of types Int and Boolean using `!=' will always yield true 1 != true ^ -checksensible.scala:36: error: comparing values of types Unit and Boolean using `==' will always yield false +checksensible.scala:40: error: comparing values of types Unit and Boolean using `==' will always yield false () == true ^ -checksensible.scala:37: error: comparing values of types Unit and Unit using `==' will always yield true +checksensible.scala:41: error: comparing values of types Unit and Unit using `==' will always yield true () == () ^ -checksensible.scala:38: error: comparing values of types Unit and Unit using `==' will always yield true +checksensible.scala:42: error: comparing values of types Unit and Unit using `==' will always yield true () == println ^ -checksensible.scala:40: error: comparing values of types Int and Unit using `!=' will always yield true +checksensible.scala:44: error: comparing values of types Int and Unit using `!=' will always yield true (1 != println) ^ -checksensible.scala:41: error: comparing values of types Int and Symbol using `!=' will always yield true +checksensible.scala:45: error: comparing values of types Int and Symbol using `!=' will always yield true (1 != 'sym) ^ -checksensible.scala:47: error: comparing a fresh object using `==' will always yield false +checksensible.scala:51: error: comparing a fresh object using `==' will always yield false ((x: Int) => x + 1) == null ^ -checksensible.scala:48: error: comparing values of types object Bep and (Int) => Int using `==' will always yield false +checksensible.scala:52: error: comparing a fresh object using `==' will always yield false Bep == ((_: Int) + 1) ^ -checksensible.scala:50: error: comparing a fresh object using `==' will always yield false +checksensible.scala:54: error: comparing a fresh object using `==' will always yield false new Object == new Object ^ -checksensible.scala:51: error: comparing a fresh object using `==' will always yield false +checksensible.scala:55: error: comparing a fresh object using `==' will always yield false new Object == "abc" ^ -checksensible.scala:52: error: comparing a fresh object using `!=' will always yield true +checksensible.scala:56: error: comparing a fresh object using `!=' will always yield true new Exception() != new Exception() ^ -checksensible.scala:55: error: comparing values of types Int and Null using `==' will always yield false +checksensible.scala:59: error: comparing values of types Int and Null using `==' will always yield false if (foo.length == null) "plante" else "plante pas" ^ -checksensible.scala:60: error: comparing values of types Bip and Bop using `==' will always yield false +checksensible.scala:64: error: comparing values of types Bip and Bop using `==' will always yield false (x1 == x2) ^ -checksensible.scala:71: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false +checksensible.scala:75: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false c3 == z1 ^ -checksensible.scala:72: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false +checksensible.scala:76: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false z1 == c3 ^ -checksensible.scala:73: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true +checksensible.scala:77: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true z1 != c3 ^ -checksensible.scala:74: error: comparing values of types EqEqRefTest.this.C3 and java.lang.String using `!=' will always yield true +checksensible.scala:78: error: comparing values of types EqEqRefTest.this.C3 and java.lang.String using `!=' will always yield true c3 != "abc" ^ -checksensible.scala:83: error: comparing values of types Unit and Int using `!=' will always yield true +checksensible.scala:87: error: comparing values of types Unit and Int using `!=' will always yield true while ((c = in.read) != -1) ^ 30 errors found diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index f67e9ea57f..e68a6ce9c7 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -27,10 +27,14 @@ class EqEqValTest { 0 == (c = 1) 1 == "abc" - "abc" == 1 // doesn't warn since String defines an equals method + 1 == ("abc": Any) // doesn't warn because an Any may be a boxed Int + 1 == (1: Any) // as above + "abc" == 1 // doesn't warn since String defines an equals method new AnyRef == 1 - 1 == new AnyRef + 1 == new AnyRef // doesn't warn because it could be... + 1 == (new java.lang.Integer(1)) // ...something like this + 1 == (new java.lang.Boolean(true)) 1 != true () == true |