File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ class ArrayApply extends MiniPhase {
2525 override def transformApply (tree : tpd.Apply )(implicit ctx : Context ): tpd.Tree = {
2626 if (tree.symbol.name == nme.apply && tree.symbol.owner == defn.ArrayModule ) { // Is `Array.apply`
2727 tree.args match {
28- case CleanTree (Apply (wrapRefArrayMeth, (seqLit : tpd.JavaSeqLiteral ) :: Nil )) :: ct :: Nil
28+ case StripAscription (Apply (wrapRefArrayMeth, (seqLit : tpd.JavaSeqLiteral ) :: Nil )) :: ct :: Nil
2929 if defn.WrapArrayMethods ().contains(wrapRefArrayMeth.symbol) && elideClassTag(ct) =>
3030 seqLit
3131
32- case elem0 :: CleanTree (Apply (wrapRefArrayMeth, (seqLit : tpd.JavaSeqLiteral ) :: Nil )) :: Nil
32+ case elem0 :: StripAscription (Apply (wrapRefArrayMeth, (seqLit : tpd.JavaSeqLiteral ) :: Nil )) :: Nil
3333 if defn.WrapArrayMethods ().contains(wrapRefArrayMeth.symbol) =>
3434 tpd.JavaSeqLiteral (elem0 :: seqLit.elems, seqLit.elemtpt)
3535
@@ -63,9 +63,8 @@ class ArrayApply extends MiniPhase {
6363 case _ => false
6464 }
6565
66- object CleanTree {
66+ object StripAscription {
6767 def unapply (tree : Tree )(implicit ctx : Context ): Some [Tree ] = tree match {
68- case Block (Nil , expr) => unapply(expr)
6968 case Typed (expr, _) => unapply(expr)
7069 case _ => Some (tree)
7170 }
You can’t perform that action at this time.
0 commit comments