summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-09-29 03:37:21 +0000
committerPaul Phillips <paulp@improving.org>2009-09-29 03:37:21 +0000
commit198f9932b94be5ef86bd6e76c5f0de992f002e2b (patch)
treeece001376bbe3940fb944c85f237d0a07de8aa30
parentf934201e2fbdb3afa3f3531d13cbc1b5a8e55966 (diff)
downloadscala-198f9932b94be5ef86bd6e76c5f0de992f002e2b.tar.gz
scala-198f9932b94be5ef86bd6e76c5f0de992f002e2b.tar.bz2
scala-198f9932b94be5ef86bd6e76c5f0de992f002e2b.zip
A couple minor tweaks I missed in the last patch.
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeDSL.scala6
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala4
2 files changed, 3 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
index 1866fee719..65c1cd7486 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeDSL.scala
@@ -119,13 +119,9 @@ trait TreeDSL {
def ===(rhs: Tree) = Assign(target, rhs)
/** Methods for sequences **/
- //[Martin] I don't understand why the toSequence call is needed.
- //It seems redundant. If you want a widening, a Typed (xxx: Sequence)
- //would be more efficient. If you want to also deal with arrays,
- //it's won't work like this, because arrays will lack the toSequence method.
def DROP(count: Int): Tree =
if (count == 0) target
- else (target DOT nme.drop)(LIT(count)) DOT nme.toSequence
+ else (target DOT nme.drop)(LIT(count))
/** Casting & type tests -- working our way toward understanding exactly
* what differs between the different forms of IS and AS.
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index c5e349bfb7..41949ad8cf 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -976,8 +976,8 @@ trait ParallelMatching extends ast.TreeDSL {
case q @ Typed(pp, _) if xIsaY => (alts(pp, q), dummy, None) // never =:= for <equals>
// case z: UnApply => (None, None, pass)
case z: UnApply => (EmptyTree, dummy, pass)
- case _ if erased.xIsaY || xIsaY && !isDef => (alts(EmptyTree, pat), subs, None) // never =:= for <e
- case _ if erased.yIsaX || yIsaX || isDef => (EmptyTree, dummy, pass) // subsuming (matched *an
+ case _ if erased.xIsaY || xIsaY && !isDef => (alts(EmptyTree, pat), subs, None) // never =:= for <equals>
+ case _ if erased.yIsaX || yIsaX || isDef => (EmptyTree, dummy, pass) // subsuming (matched *and* remaining pattern)
case _ => (None, None, pass)
// The below fixes bugs 425 and 816 with only the small downside
// of causing 60 other tests to fail.