Skip to content

Commit 6fe3a2d

Browse files
committed
Fix Erasure.Boxing isBox and isUnbox
Box& unbox methods are defined in companion objects.
1 parent f2ea8dd commit 6fe3a2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ object Erasure extends TypeTestsCasts{
111111
object Boxing {
112112

113113
def isUnbox(sym: Symbol)(implicit ctx: Context) =
114-
sym.name == nme.unbox && (defn.ScalaBoxedClasses contains sym.owner)
114+
sym.name == nme.unbox && (defn.ScalaBoxedClasses contains sym.owner.linkedClass)
115115

116116
def isBox(sym: Symbol)(implicit ctx: Context) =
117-
sym.name == nme.box && (defn.ScalaValueClasses contains sym.owner)
117+
sym.name == nme.box && (defn.ScalaValueClasses contains sym.owner.linkedClass)
118118

119119
def boxMethod(cls: ClassSymbol)(implicit ctx: Context) =
120120
cls.linkedClass.info.member(nme.box).symbol

0 commit comments

Comments
 (0)