summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-11-23 18:12:34 +0000
committerMartin Odersky <odersky@gmail.com>2009-11-23 18:12:34 +0000
commit4daa662deacf306cd63b0c26c5112bc210eb4e87 (patch)
tree0f8b87cef82f55fb245b49705ab467a4b2c9c46a /src
parent269486307ad8b15d436467f8035174588ebe9294 (diff)
downloadscala-4daa662deacf306cd63b0c26c5112bc210eb4e87.tar.gz
scala-4daa662deacf306cd63b0c26c5112bc210eb4e87.tar.bz2
scala-4daa662deacf306cd63b0c26c5112bc210eb4e87.zip
Closed #1545
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 8f49d469f4..5409a0fe45 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -297,11 +297,11 @@ abstract class UnCurry extends InfoTransform with TypingTransformers {
* new $anon()
*
* transform a function node (x => body) of type PartialFunction[T, R] where
- * body = x match { case P_i if G_i => E_i }_i=1..n
+ * body = expr match { case P_i if G_i => E_i }_i=1..n
* to:
*
* class $anon() extends Object() with PartialFunction[T, R] with ScalaObject {
- * def apply(x: T): R = (x: @unchecked) match {
+ * def apply(x: T): R = (expr: @unchecked) match {
* { case P_i if G_i => E_i }_i=1..n
* def isDefinedAt(x: T): boolean = (x: @unchecked) match {
* case P_1 if G_1 => true
@@ -361,8 +361,8 @@ abstract class UnCurry extends InfoTransform with TypingTransformers {
BooleanClass.tpe))
anonClass.info.decls enter isDefinedAtMethod
def idbody(idparam: Symbol) = fun.body match {
- case Match(_, cases) =>
- val substParam = new TreeSymSubstituter(List(fun.vparams.head.symbol), List(idparam));
+ case Match(selector, cases) =>
+ val substParam = new TreeSymSubstituter(List(fun.vparams.head.symbol), List(idparam))
def transformCase(cdef: CaseDef): CaseDef =
substParam(
resetLocalAttrs(
@@ -370,7 +370,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers {
if (cases exists treeInfo.isDefaultCase) Literal(true)
else
Match(
- Ident(idparam),
+ substParam(resetLocalAttrs(selector.duplicate)),
(cases map transformCase) :::
List(CaseDef(Ident(nme.WILDCARD), EmptyTree, Literal(false))))
}