summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala9
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
+ }
})
}