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:
parent
f7b7ad5894
commit
422a24831a
|
@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue