diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-04-24 18:40:12 +0200 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-04-24 18:54:21 +0200 |
commit | a47acbc36d312cc12ab02f4564edff1deb93d941 (patch) | |
tree | c433d551cb69e7d26f7f291e4659a45c4f569c08 /src/library | |
parent | 2890714d7bcdd55b7a62091dcdf031cc3efe0822 (diff) | |
download | scala-a47acbc36d312cc12ab02f4564edff1deb93d941.tar.gz scala-a47acbc36d312cc12ab02f4564edff1deb93d941.tar.bz2 scala-a47acbc36d312cc12ab02f4564edff1deb93d941.zip |
copy BackQuotedIdent trees (don't copy as Ident)
typer synthesized the wrong isDefinedAt method in typedMatchAnon
because a BackQuotedIdent was copied as an Ident, so that the equality check
was performed in applyOrElse (since it operates on the original tree),
but not in isDefinedAt (since it operates on the copy, which collapsed Ident and BackQuotedIdent)
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/reflect/api/Trees.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library/scala/reflect/api/Trees.scala b/src/library/scala/reflect/api/Trees.scala index 6e2e8261e7..2f6dc820a5 100644 --- a/src/library/scala/reflect/api/Trees.scala +++ b/src/library/scala/reflect/api/Trees.scala @@ -1171,7 +1171,10 @@ trait Trees { self: Universe => def Select(tree: Tree, qualifier: Tree, selector: Name) = new Select(qualifier, selector).copyAttrs(tree) def Ident(tree: Tree, name: Name) = - new Ident(name).copyAttrs(tree) + (tree match { + case _ : BackQuotedIdent => new BackQuotedIdent(name) + case _ => new Ident(name) + }).copyAttrs(tree) def ReferenceToBoxed(tree: Tree, idt: Ident) = new ReferenceToBoxed(idt).copyAttrs(tree) def Literal(tree: Tree, value: Constant) = |