Optimized away box(unbox(E)) ===> E.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@22807 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
dragos 2010-08-23 08:51:47 +00:00
parent f7b7ad5894
commit 422a24831a
1 changed files with 8 additions and 1 deletions

View File

@ -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
}
})
}