Skip to content

Commit 306db60

Browse files
committed
1 parent 608effe commit 306db60

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/compiler/scala/tools/nsc/transform/CleanUp.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,10 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL {
620620
case Apply(appMeth @ Select(appMethQual, _), elem0 :: Apply(wrapArrayMeth, (rest @ ArrayValue(elemtpt, _)) :: Nil) :: Nil)
621621
if wrapArrayMeth.symbol == wrapVarargsArrayMethod(elemtpt.tpe) && appMeth.symbol == ArrayModule_apply(elemtpt.tpe) && treeInfo.isQualifierSafeToElide(appMethQual) =>
622622
treeCopy.ArrayValue(rest, rest.elemtpt, elem0 :: rest.elems).transform(this)
623-
// See scala/bug#12201, should be rewrite as Primitive Array.
624-
case Apply(_@Select(appMethQual, _), Apply(wrapRefArrayMeth, StripCast(ArrayValue(elemtpt, elems)) :: Nil) :: _ :: Nil)
625-
if treeInfo.isQualifierSafeToElide(appMethQual) && currentRun.runDefinitions.primitiveWrapArrayMethod.contains(wrapRefArrayMeth.symbol) =>
623+
// See scala/bug#12201, should be rewrite as Primitive Array.
624+
// Match Array
625+
case Apply(appMeth @ Select(appMethQual, _), Apply(wrapRefArrayMeth, StripCast(ArrayValue(elemtpt, elems)) :: Nil) :: _ :: Nil)
626+
if appMethQual.symbol.getterName == TermName("Array") && treeInfo.isQualifierSafeToElide(appMethQual) && currentRun.runDefinitions.primitiveWrapArrayMethod.contains(wrapRefArrayMeth.symbol) =>
626627
localTyper.typedPos(elemtpt.pos) {
627628
ArrayValue(TypeTree(elemtpt.tpe), elems)
628629
} transform this

0 commit comments

Comments
 (0)