Skip to content

Commit 7de8e7c

Browse files
committed
Fix #3518: Erase explicit Unit.box and Unit.unbox in erasure
1 parent c48f7b0 commit 7de8e7c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ object Erasure {
479479
val Apply(fun, args) = tree
480480
if (fun.symbol == defn.cbnArg)
481481
typedUnadapted(args.head, pt)
482+
else if ((tree.symbol.name == nme.box || tree.symbol.name == nme.unbox) && tree.symbol.owner.asClass.companionClass == defn.UnitClass) ref(defn.BoxedUnit_UNIT)
482483
else typedExpr(fun, FunProto(args, pt, this)) match {
483484
case fun1: Apply => // arguments passed in prototype were already passed
484485
fun1

0 commit comments

Comments
 (0)