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 /test | |
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 'test')
-rw-r--r-- | test/files/run/virtpatmat_partial_backquoted.check | 1 | ||||
-rw-r--r-- | test/files/run/virtpatmat_partial_backquoted.scala | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/test/files/run/virtpatmat_partial_backquoted.check b/test/files/run/virtpatmat_partial_backquoted.check new file mode 100644 index 0000000000..8ab8f29677 --- /dev/null +++ b/test/files/run/virtpatmat_partial_backquoted.check @@ -0,0 +1 @@ +Set(You got me!) 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 |