diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-18 17:57:29 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-18 17:57:29 +0000 |
commit | d0a36c66cb18d94d15d44e5a04ed91ab00a43418 (patch) | |
tree | c0f1dc70b271d09f776399c0b3e70235500d0a52 /test/files/neg/checksensible.scala | |
parent | 23ab7e3c9a46ef6c509a452f8ee3d2f224235bde (diff) | |
download | scala-d0a36c66cb18d94d15d44e5a04ed91ab00a43418.tar.gz scala-d0a36c66cb18d94d15d44e5a04ed91ab00a43418.tar.bz2 scala-d0a36c66cb18d94d15d44e5a04ed91ab00a43418.zip |
Fix for comparison warnings.
true == new java.lang.Boolean(true) will in fact sometimes be true. Also
fixes a bug caused by this change in r23627.
- lazy val SerializableClass = getClass(sn.Serializable)
+ lazy val SerializableClass = getClass("scala.Serializable")
It used to be java.io.Serializable. Hey, let's not change the meaning of
existing symbols which are in active use. No review.
Diffstat (limited to 'test/files/neg/checksensible.scala')
-rw-r--r-- | test/files/neg/checksensible.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index 77b5a93f74..b6083f75e4 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -32,6 +32,9 @@ class EqEqValTest { "abc" == 1 // warns because the lub of String and Int is Any Some(1) == 1 // as above + true == new java.lang.Boolean(true) // none of these should warn + new java.lang.Boolean(true) == true + new AnyRef == 1 1 == new AnyRef // doesn't warn because it could be... 1 == (new java.lang.Integer(1)) // ...something like this @@ -41,6 +44,9 @@ class EqEqValTest { () == true () == () () == println + () == scala.runtime.BoxedUnit.UNIT // these should warn for always being true/false + scala.runtime.BoxedUnit.UNIT != () + (scala.runtime.BoxedUnit.UNIT: java.io.Serializable) != () // shouldn't warn (1 != println) (1 != 'sym) |