diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-01 16:25:54 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-01 16:25:54 +0000 |
commit | a37284fdf7e2b2917c9e894a9b93c02d1defc983 (patch) | |
tree | 78e074b4ba89ed710ae15ea3bca11fbec606a695 /test/files/neg/checksensible.scala | |
parent | 8a959d80f17eff0ebcc09defff16beac21909ed5 (diff) | |
download | scala-a37284fdf7e2b2917c9e894a9b93c02d1defc983.tar.gz scala-a37284fdf7e2b2917c9e894a9b93c02d1defc983.tar.bz2 scala-a37284fdf7e2b2917c9e894a9b93c02d1defc983.zip |
More fiddling with checkSensible.
warnings. Fixed some bugs revealed by said warnings, and made some minor
changes to avoid warnings. (Technically it's not a bug to have unrelated
classes compare as equal, but it so often is a bug that it behooves us
not to do it intentionally so the warnings stand out.) Disabled the most
useful warning for the moment since it'd be wrong with some frequency.
No review.
Diffstat (limited to 'test/files/neg/checksensible.scala')
-rw-r--r-- | test/files/neg/checksensible.scala | 7 |
1 files changed, 4 insertions, 3 deletions
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) |