Skip to content

Commit 4cdbcda

Browse files
committed
Use ScalaBoxedClasses
1 parent 7db8083 commit 4cdbcda

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@ class ArrayApply extends MiniPhase {
4949
case Apply(_, rc :: Nil) if ct.symbol == defn.ClassTagModule_apply =>
5050
rc match {
5151
case _: Literal => true // ClassTag.apply(classOf[XYZ])
52-
case rc: RefTree if rc.name == nme.TYPE_ => // ClassTag.apply(java.lang.XYZ.Type)
53-
val owner = rc.symbol.maybeOwner.companionModule
54-
owner == defn.BoxedBooleanModule || owner == defn.BoxedByteModule ||
55-
owner == defn.BoxedShortModule || owner == defn.BoxedCharModule ||
56-
owner == defn.BoxedIntModule || owner == defn.BoxedLongModule ||
57-
owner == defn.BoxedFloatModule || owner == defn.BoxedDoubleModule ||
58-
owner == defn.BoxedUnitModule
52+
case rc: RefTree if rc.name == nme.TYPE_ =>
53+
// ClassTag.apply(java.lang.XYZ.Type)
54+
defn.ScalaBoxedClasses().contains(rc.symbol.maybeOwner.companionClass)
5955
case _ => false
6056
}
6157
case Apply(ctm: RefTree, _) if ctm.symbol.maybeOwner.companionModule == defn.ClassTagModule =>

0 commit comments

Comments
 (0)