Skip to content

Commit 4ca7d8d

Browse files
committed
Use boxMethod and unboxMethod for Unit
1 parent c437512 commit 4ca7d8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ object Erasure {
477477
*/
478478
override def typedApply(tree: untpd.Apply, pt: Type)(implicit ctx: Context): Tree = {
479479
val Apply(fun, args) = tree
480-
if (fun.symbol == defn.cbnArg || (tree.symbol.name == nme.box || tree.symbol.name == nme.unbox) && tree.symbol.owner.asClass.companionClass == defn.UnitClass)
480+
if (fun.symbol == defn.cbnArg || fun.symbol == boxMethod(defn.UnitClass) || fun.symbol == unboxMethod(defn.UnitClass))
481481
typedUnadapted(args.head, pt)
482482
else typedExpr(fun, FunProto(args, pt, this)) match {
483483
case fun1: Apply => // arguments passed in prototype were already passed

0 commit comments

Comments
 (0)