summaryrefslogtreecommitdiff
path: root/test/files/run/virtpatmat_partial_backquoted.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-04-24 18:40:12 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-04-24 18:54:21 +0200
commita47acbc36d312cc12ab02f4564edff1deb93d941 (patch)
treec433d551cb69e7d26f7f291e4659a45c4f569c08 /test/files/run/virtpatmat_partial_backquoted.scala
parent2890714d7bcdd55b7a62091dcdf031cc3efe0822 (diff)
downloadscala-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 'test/files/run/virtpatmat_partial_backquoted.scala')
-rw-r--r--test/files/run/virtpatmat_partial_backquoted.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/virtpatmat_partial_backquoted.scala b/test/files/run/virtpatmat_partial_backquoted.scala
new file mode 100644
index 0000000000..6d92229d6b
--- /dev/null
+++ b/test/files/run/virtpatmat_partial_backquoted.scala
@@ -0,0 +1,12 @@
+object Test extends App {
+ class Region { override def toString = "You got me!" }
+ class SymbolType
+ case class SymbolInfo(tp: SymbolType, regions: List[Region], x: Any)
+
+ def findRegionsWithSymbolType(rawSymbolInfos: Seq[SymbolInfo], symbolType: SymbolType): Set[Region] =
+ rawSymbolInfos.collect { case SymbolInfo(`symbolType`, regions, _) => regions }.flatten.toSet
+
+ val stp = new SymbolType
+ val stp2 = new SymbolType
+ println(findRegionsWithSymbolType(List(SymbolInfo(stp2, List(), null), SymbolInfo(stp, List(new Region), null)), stp))
+} \ No newline at end of file