From 6e53e14f4d2a6f84645b4d22000e034e56e6492c Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 14 Mar 2007 14:43:14 +0000 Subject: partial fix of bug 999 --- src/compiler/scala/tools/nsc/transform/UnCurry.scala | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 58fb903aec..7929833e6d 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -384,15 +384,17 @@ abstract class UnCurry extends InfoTransform with TypingTransformers { mainTransform(new TreeSubstituter(vparams map (.symbol), args).transform(body)) } - case UnApply(fn, args) if nme.unapply == fn.symbol.name => - copy.UnApply(tree, fn, transformTrees(args)) - - case UnApply(fn, args) if nme.unapplySeq == fn.symbol.name => - val formals = definitions.unapplyTypeListFromReturnTypeSeq(fn.tpe) - copy.UnApply(tree, fn, transformTrees(transformArgs(tree.pos, args, formals))) - - case UnApply(_, _) => - assert(false,"internal error: UnApply node has wrong symbol"); null + case UnApply(fn, args) => + inPattern = false + val fn1 = transform(fn) + inPattern = true + val args1 = transformTrees( + if (fn.symbol.name == nme.unapply) + args + else if (fn.symbol.name == nme.unapplySeq) + transformArgs(tree.pos, args, definitions.unapplyTypeListFromReturnTypeSeq(fn.tpe)) + else { assert(false,"internal error: UnApply node has wrong symbol"); null }) + copy.UnApply(tree, fn1, args1) case Apply(fn, args) => if (settings.noassertions.value && -- cgit v1.2.3