diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/checksensible.check | 10 | ||||
-rw-r--r-- | test/files/neg/checksensible.scala | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 67a76dd7be..9977739196 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -73,19 +73,19 @@ checksensible.scala:59: error: comparing values of types Int and Null using `==' checksensible.scala:64: error: comparing values of types Bip and Bop using `==' will always yield false (x1 == x2) ^ -checksensible.scala:75: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false +checksensible.scala:74: error: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false c3 == z1 ^ -checksensible.scala:76: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false +checksensible.scala:75: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false z1 == c3 ^ -checksensible.scala:77: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true +checksensible.scala:76: error: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true z1 != c3 ^ -checksensible.scala:78: error: comparing values of types EqEqRefTest.this.C3 and java.lang.String using `!=' will always yield true +checksensible.scala:77: error: comparing values of types EqEqRefTest.this.C3 and java.lang.String using `!=' will always yield true c3 != "abc" ^ -checksensible.scala:87: error: comparing values of types Unit and Int using `!=' will always yield true +checksensible.scala:88: 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 e68a6ce9c7..4872df4dfb 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -29,7 +29,7 @@ class EqEqValTest { 1 == "abc" 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 + "abc" == 1 // doesn't generally warn since String defines an equals method, but can chatty warn new AnyRef == 1 1 == new AnyRef // doesn't warn because it could be... @@ -70,12 +70,13 @@ class EqEqRefTest { val z1 = new Z1 val c3 = new C3 - // all but c3 != z1 should warn - c3 != z1 + // these should always warn c3 == z1 z1 == c3 z1 != c3 c3 != "abc" + // this should warn when feeling chatty + c3 != z1 // non-warners (null: AnyRef) == (null: AnyRef) |