diff options
author | Burak Emir <emir@epfl.ch> | 2006-06-15 23:11:09 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-06-15 23:11:09 +0000 |
commit | 8f94fcf9484424c8b4487590a3d9ec02e546841f (patch) | |
tree | 1870abd33821dc47f076832e72c9039363a245f1 | |
parent | 4f69e5325de4a66f67485a9a6ed03795597b644a (diff) | |
download | scala-8f94fcf9484424c8b4487590a3d9ec02e546841f.tar.gz scala-8f94fcf9484424c8b4487590a3d9ec02e546841f.tar.bz2 scala-8f94fcf9484424c8b4487590a3d9ec02e546841f.zip |
fixed optim of Array(xs@_*) but broken elsewhere
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/TransMatcher.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala index 23f33ac29f..898d82c28e 100644 --- a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala +++ b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala @@ -215,13 +215,14 @@ with RightTracers { isReg = true; // cause there are ArrayValues now copy.Sequence(pat, trees map { isRegular1 }); - case ArrayValue( tt, List(b @ Bind(id, Star(wc @ Ident(nme.WILDCARD))))) => + //case ArrayValue( tt, List(b @ Bind(id, Star(wc @ Ident(nme.WILDCARD))))) => + case Apply(fn, List(pat2, ArrayValue( tt, List(b @ Bind(id, Star(wc @ Ident(nme.WILDCARD))))))) => //Console.println("OPTIMIZING"); //Console.println(pat); //Console.println(pat.tpe); //Console.println(b.tpe); - b.symbol.setInfo(pat.tpe); - b.setType(pat.tpe); + b.symbol.setInfo(pat2.tpe); + b.setType(pat2.tpe); val res = copy.Bind(b, id, wc); //Console.println("====>"); //Console.println(res); @@ -249,7 +250,7 @@ with RightTracers { // Console.println(pat); // Console.println(pat.getClass()); // scala.Predef.error"( what is this ? ") - } + } var res:List[CaseDef] = Nil; val it = pats.elements; while(it.hasNext) { @@ -268,7 +269,7 @@ with RightTracers { res = copy.CaseDef(cdef, newt, cdef.guard, nbody) :: res; } Pair(res.reverse, existsReg); - } + } |