summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/LazyVals.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-11-19 20:31:46 +0000
committerPaul Phillips <paulp@improving.org>2009-11-19 20:31:46 +0000
commit04a99160c27257565438b58e814c885283521358 (patch)
tree55696ed37c7172f2938fe4f212949cee28dc1728 /src/compiler/scala/tools/nsc/transform/LazyVals.scala
parent1e1c87c234826279a58c97bc5124f2e76ab58dce (diff)
downloadscala-04a99160c27257565438b58e814c885283521358.tar.gz
scala-04a99160c27257565438b58e814c885283521358.tar.bz2
scala-04a99160c27257565438b58e814c885283521358.zip
Deprecation patrol exercises the new capabiliti...
Deprecation patrol exercises the new capabilities in Tuple2.zipped among other exciting no-ops.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/LazyVals.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/LazyVals.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/LazyVals.scala b/src/compiler/scala/tools/nsc/transform/LazyVals.scala
index 16c5f8754d..b2f9489480 100644
--- a/src/compiler/scala/tools/nsc/transform/LazyVals.scala
+++ b/src/compiler/scala/tools/nsc/transform/LazyVals.scala
@@ -94,10 +94,11 @@ abstract class LazyVals extends Transform with ast.TreeDSL {
}
val bmps = bitmaps(methSym) map (ValDef(_, ZERO))
+ def isMatch(params: List[Ident]) = (params.tail, methSym.tpe.paramTypes).zipped forall (_.tpe == _)
+
if (bmps.isEmpty) rhs else rhs match {
case Block(assign, l @ LabelDef(name, params, rhs1))
- if (name.toString.equals("_" + methSym.name)
- && List.forall2(params.tail, methSym.tpe.paramTypes) { (ident, tpe) => ident.tpe == tpe }) =>
+ if name.toString == ("_" + methSym.name) && isMatch(params) =>
val sym = l.symbol
Block(assign, treeCopy.LabelDef(l, name, params, typed(prependStats(bmps, rhs1))))