diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-08-23 08:51:47 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-08-23 08:51:47 +0000 |
commit | 3c001a598de605843255df06b0708a6d04c8ac30 (patch) | |
tree | dcafc4cb35bee8d4ad1ffccb2a2d7b75d580ea74 | |
parent | b3982fcf27f9a4553152dccd1e3c6df68ebe0f67 (diff) | |
download | scala-3c001a598de605843255df06b0708a6d04c8ac30.tar.gz scala-3c001a598de605843255df06b0708a6d04c8ac30.tar.bz2 scala-3c001a598de605843255df06b0708a6d04c8ac30.zip |
Optimized away box(unbox(E)) ===> E.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 28ff336f60..814434d46c 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -469,7 +469,14 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer with ast. else BLOCK(tree, REF(BoxedUnit_UNIT)) case x => assert(x != ArrayClass) - (REF(boxMethod(x)) APPLY tree) setPos (tree.pos) setType ObjectClass.tpe + tree match { + case Apply(boxFun, List(arg)) if (isUnbox(tree.symbol)) => + log("boxing an unbox: " + tree) + log("replying with " + arg) + arg + case _ => + (REF(boxMethod(x)) APPLY tree) setPos (tree.pos) setType ObjectClass.tpe + } }) } |