summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-02-16 12:02:06 +0000
committerMartin Odersky <odersky@gmail.com>2007-02-16 12:02:06 +0000
commit6e23c62953e97277b3e912b81da37fd64556221b (patch)
tree092ff3ea3b46da7dd3aafb3aed9837b213cec520 /src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
parent5c8c46664d780041be192f6bba7ce44875d8e9e1 (diff)
downloadscala-6e23c62953e97277b3e912b81da37fd64556221b.tar.gz
scala-6e23c62953e97277b3e912b81da37fd64556221b.tar.bz2
scala-6e23c62953e97277b3e912b81da37fd64556221b.zip
fixed unary_ops
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
index 7323b17fa3..68dd7368a9 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ConstantFolder.scala
@@ -50,20 +50,20 @@ abstract class ConstantFolder {
}
private def foldUnop(op: Name, x: Constant): Constant = Pair(op, x.tag) match {
- case Pair(nme.ZNOT, BooleanTag) => Constant(!x.booleanValue)
+ case Pair(nme.UNARY_!, BooleanTag) => Constant(!x.booleanValue)
- case Pair(nme.NOT , IntTag ) => Constant(~x.intValue)
- case Pair(nme.NOT , LongTag ) => Constant(~x.longValue)
+ case Pair(nme.UNARY_~ , IntTag ) => Constant(~x.intValue)
+ case Pair(nme.UNARY_~ , LongTag ) => Constant(~x.longValue)
- case Pair(nme.ADD , IntTag ) => Constant(+x.intValue)
- case Pair(nme.ADD , LongTag ) => Constant(+x.longValue)
- case Pair(nme.ADD , FloatTag ) => Constant(+x.floatValue)
- case Pair(nme.ADD , DoubleTag ) => Constant(+x.doubleValue)
+ case Pair(nme.UNARY_+ , IntTag ) => Constant(+x.intValue)
+ case Pair(nme.UNARY_+ , LongTag ) => Constant(+x.longValue)
+ case Pair(nme.UNARY_+ , FloatTag ) => Constant(+x.floatValue)
+ case Pair(nme.UNARY_+ , DoubleTag ) => Constant(+x.doubleValue)
- case Pair(nme.SUB , IntTag ) => Constant(-x.intValue)
- case Pair(nme.SUB , LongTag ) => Constant(-x.longValue)
- case Pair(nme.SUB , FloatTag ) => Constant(-x.floatValue)
- case Pair(nme.SUB , DoubleTag ) => Constant(-x.doubleValue)
+ case Pair(nme.UNARY_- , IntTag ) => Constant(-x.intValue)
+ case Pair(nme.UNARY_- , LongTag ) => Constant(-x.longValue)
+ case Pair(nme.UNARY_- , FloatTag ) => Constant(-x.floatValue)
+ case Pair(nme.UNARY_- , DoubleTag ) => Constant(-x.doubleValue)
case _ => null
}