summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/CleanUp.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-01-16 21:31:31 +0000
committerMartin Odersky <odersky@gmail.com>2011-01-16 21:31:31 +0000
commitcf820b8907e60214df974a3b2a88ca0a7e877298 (patch)
treed84b96abaec22ee0258ceb490917ab2dcd4b71ac /src/compiler/scala/tools/nsc/transform/CleanUp.scala
parent3414335ced07828aef1f50e1e61384c026391376 (diff)
downloadscala-cf820b8907e60214df974a3b2a88ca0a7e877298.tar.gz
scala-cf820b8907e60214df974a3b2a88ca0a7e877298.tar.bz2
scala-cf820b8907e60214df974a3b2a88ca0a7e877298.zip
Dynamic type added. Array creation optimized.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/CleanUp.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
index 66c22fb1ef..3c9e701ee9 100644
--- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala
+++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
@@ -595,6 +595,16 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
val ntree = typedWithPos(symapp.pos)(REF(staticFieldSym))
super.transform(ntree)
+
+ // This transform replaces Array(Predef.wrapArray(Array(...)), <manifest>)
+ // with just Array(...)
+ case Apply(appMeth, List(Apply(wrapRefArrayMeth, List(array)), _))
+ if (wrapRefArrayMeth.symbol == Predef_wrapRefArray &&
+ appMeth.symbol == ArrayModule_overloadedApply.suchThat {
+ _.tpe.resultType.dealias.typeSymbol == ObjectClass
+ }) =>
+ super.transform(array)
+
case _ =>
super.transform(tree)
}