summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-09-23 05:13:16 +0000
committerPaul Phillips <paulp@improving.org>2009-09-23 05:13:16 +0000
commit9e54361343f80925ab7be84239ce37fb021bd7b9 (patch)
tree797158e9ff60c8c3edb43a438d840da93b77d8a0
parent48fe27d8fb0357b29484f91f07caf52b2d857367 (diff)
downloadscala-9e54361343f80925ab7be84239ce37fb021bd7b9.tar.gz
scala-9e54361343f80925ab7be84239ce37fb021bd7b9.tar.bz2
scala-9e54361343f80925ab7be84239ce37fb021bd7b9.zip
Removed redundant method isValueType.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Definitions.scala6
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala8
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala2
3 files changed, 5 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
index 33cf985dcd..5c7d8229e3 100644
--- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala
@@ -689,12 +689,6 @@ trait Definitions {
def isNumericValueClass(sym: Symbol): Boolean =
(sym ne BooleanClass) && (boxedClass contains sym)
- // !!! todo merge with isValueClass
- def isValueType(sym: Symbol) = {
- assert(isValueClass(sym) || !unboxMethod.contains(sym))
- isValueClass(sym) || unboxMethod.contains(sym)
- }
-
def signature(tp: Type): String = {
def erasure(tp: Type): Type = tp match {
case st: SubType => erasure(st.supertype)
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 37f28ec08e..c9eb666bfb 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -154,7 +154,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast.
apply(atp)
case ClassInfoType(parents, decls, clazz) =>
ClassInfoType(
- if ((clazz == ObjectClass) || (isValueType(clazz))) List()
+ if ((clazz == ObjectClass) || (isValueClass(clazz))) List()
else if (clazz == ArrayClass) List(erasedTypeRef(ObjectClass))
else removeDoubleObject(parents map this),
decls, clazz)
@@ -573,7 +573,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast.
atPos(tree.pos)(Apply(Select(qual1, "to" + targClass.name), List()))
else
*/
- if (isValueType(targClass)) unbox(qual1, targ.tpe)
+ if (isValueClass(targClass)) unbox(qual1, targ.tpe)
else tree
case Select(qual, name) if (name != nme.CONSTRUCTOR) =>
if (tree.symbol == NoSymbol)
@@ -586,9 +586,9 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast.
adaptMember(atPos(tree.pos)(Select(qual, getMember(ObjectClass, name))))
else {
var qual1 = typedQualifier(qual);
- if ((isValueType(qual1.tpe.typeSymbol) && !isUnboxedValueMember(tree.symbol)))
+ if ((isValueClass(qual1.tpe.typeSymbol) && !isUnboxedValueMember(tree.symbol)))
qual1 = box(qual1)
- else if (!isValueType(qual1.tpe.typeSymbol) && isUnboxedValueMember(tree.symbol))
+ else if (!isValueClass(qual1.tpe.typeSymbol) && isUnboxedValueMember(tree.symbol))
qual1 = unbox(qual1, tree.symbol.owner.tpe)
if (isValueClass(tree.symbol.owner) && !isValueClass(qual1.tpe.typeSymbol))
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index ea2420ac79..03526665dd 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -667,7 +667,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
// println("\tunify \t" + tp1 + "\n\t\t" + tp2)
(tp1, tp2) match {
case (TypeRef(_, sym1, _), _) if sym1.hasAnnotation(SpecializedClass) =>
- if (definitions.isValueType(tp2.typeSymbol))
+ if (definitions.isValueClass(tp2.typeSymbol))
env + ((sym1, tp2))
else
env