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 /src/compiler/scala/reflect/internal/Definitions.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 'src/compiler/scala/reflect/internal/Definitions.scala')
-rw-r--r-- | src/compiler/scala/reflect/internal/Definitions.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/reflect/internal/Definitions.scala b/src/compiler/scala/reflect/internal/Definitions.scala index 654639adae..4ee717ce75 100644 --- a/src/compiler/scala/reflect/internal/Definitions.scala +++ b/src/compiler/scala/reflect/internal/Definitions.scala @@ -784,12 +784,12 @@ trait Definitions extends reflect.api.StandardDefinitions { /** Is symbol a boxed value class, e.g. java.lang.Integer? */ def isBoxedValueClass(sym: Symbol) = boxedValueClassesSet(sym) - /** If symbol is a value class, return the value class, with the exception - * that BoxedUnit remains BoxedUnit. If not a value class, NoSymbol. + /** If symbol is a value class (boxed or not), return the unboxed + * value class. Otherwise, NoSymbol. */ def unboxedValueClass(sym: Symbol): Symbol = if (isValueClass(sym)) sym - else if (sym == BoxedUnitClass) sym + else if (sym == BoxedUnitClass) UnitClass else boxedClass.map(_.swap).getOrElse(sym, NoSymbol) /** Is type's symbol a numeric value class? */ |