diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2009-12-10 15:32:30 +0000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2009-12-10 15:32:30 +0000 |
commit | 63f5dbb0a67f8a61f4480a79863a99010bb00c6e (patch) | |
tree | 37ae4bc732fff0073969d3938672799e7a95040a /src/compiler | |
parent | f8d6169dd378c7ebed25d811b28eda2572287931 (diff) | |
download | scala-63f5dbb0a67f8a61f4480a79863a99010bb00c6e.tar.gz scala-63f5dbb0a67f8a61f4480a79863a99010bb00c6e.tar.bz2 scala-63f5dbb0a67f8a61f4480a79863a99010bb00c6e.zip |
closes #2784
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index 45249bde66..6802757083 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -145,8 +145,14 @@ abstract class TreeBuilder { /** Create tree representing (unencoded) binary operation expression or pattern. */ def makeBinop(isExpr: Boolean, left: Tree, op: Name, right: Tree, opPos: Position): Tree = { + def mkNamed(args: List[Tree]) = + if (isExpr) args map { + case a @ Assign(id @ Ident(name), rhs) => + atPos(a.pos) { AssignOrNamedArg(id, rhs) } + case e => e + } else args val arguments = right match { - case Parens(args) => args + case Parens(args) => mkNamed(args) case _ => List(right) } if (isExpr) { |