summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2006-07-12 12:23:42 +0000
committerBurak Emir <emir@epfl.ch>2006-07-12 12:23:42 +0000
commitb53dced1215bffa82ae3f4aa38f614e4a0f48a7d (patch)
tree088a69bfcb55988b9bd980cef71f660566d9eba2 /src
parente4fc9bd2fc3f14e603ff9000fde78fef021c1090 (diff)
downloadscala-b53dced1215bffa82ae3f4aa38f614e4a0f48a7d.tar.gz
scala-b53dced1215bffa82ae3f4aa38f614e4a0f48a7d.tar.bz2
scala-b53dced1215bffa82ae3f4aa38f614e4a0f48a7d.zip
fixed bug #654 and removed generation of an unn...
fixed bug #654 and removed generation of an unnecessary duplicate cast
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/matching/PatternMatchers.scala2
-rw-r--r--src/compiler/scala/tools/nsc/matching/TransMatcher.scala7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala
index 68c591b2e7..cee49c7df5 100644
--- a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala
+++ b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala
@@ -1063,7 +1063,7 @@ trait PatternMatchers requires (TransMatcher with PatternNodes) extends AnyRef w
ValDef(casted,
gen.mkAsInstanceOf(selector.duplicate, node.getTpe(), true)),
ValDef(castedRest, {
- var res:Tree = gen.mkAsInstanceOf(selector.duplicate, node.getTpe(), true);
+ var res:Tree = Ident(casted) // gen.mkAsInstanceOf(selector.duplicate, node.getTpe(), true);
if(minlen != 0) {
res = Apply(Select(Select(res, "toList"), "drop"),List(Literal(Constant(minlen))))
diff --git a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
index 0ad9b4ff80..4d85f50772 100644
--- a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
+++ b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
@@ -219,11 +219,14 @@ with RightTracers {
//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))))))) =>
+ 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)
+ //Console.println(tt.tpe)
+ //Console.println("b.tpe "+b.tpe+" widened"+b.tpe.widen)
+ //Console.println("b.symbol.tpe "+b.symbol.tpe+" widened"+b.symbol.tpe.widen)
+ //Console.println("pat2.tpe "+pat2.tpe+" widened"+pat2.tpe.widen)
val tpe1:Type = pat2.tpe.widen.baseType( definitions.SeqClass ).typeArgs(0)
val tpe = appliedType(definitions.SeqClass.typeConstructor, List(tpe1))