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 {
25
25
override def transformApply (tree : tpd.Apply )(implicit ctx : Context ): tpd.Tree = {
26
26
if (tree.symbol.name == nme.apply && tree.symbol.owner == defn.ArrayModule ) { // Is `Array.apply`
27
27
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
29
29
if defn.WrapArrayMethods ().contains(wrapRefArrayMeth.symbol) && elideClassTag(ct) =>
30
30
seqLit
31
31
32
- case elem0 :: CleanTree (Apply (wrapRefArrayMeth, (seqLit : tpd.JavaSeqLiteral ) :: Nil )) :: Nil
32
+ case elem0 :: StripAscription (Apply (wrapRefArrayMeth, (seqLit : tpd.JavaSeqLiteral ) :: Nil )) :: Nil
33
33
if defn.WrapArrayMethods ().contains(wrapRefArrayMeth.symbol) =>
34
34
tpd.JavaSeqLiteral (elem0 :: seqLit.elems, seqLit.elemtpt)
35
35
@@ -63,9 +63,8 @@ class ArrayApply extends MiniPhase {
63
63
case _ => false
64
64
}
65
65
66
- object CleanTree {
66
+ object StripAscription {
67
67
def unapply (tree : Tree )(implicit ctx : Context ): Some [Tree ] = tree match {
68
- case Block (Nil , expr) => unapply(expr)
69
68
case Typed (expr, _) => unapply(expr)
70
69
case _ => Some (tree)
71
70
}
You can’t perform that action at this time.
0 commit comments