summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-07-06 14:07:47 +0000
committerBurak Emir <emir@epfl.ch>2007-07-06 14:07:47 +0000
commit6b9c0247506e46321dfedaa01b37a9696cb21014 (patch)
treead78698d2748df594e1d4b7c2ff7bbbc71c7fa68
parentad89e1d2ffa6860b771bb7753b5cac93f1b24fa4 (diff)
downloadscala-6b9c0247506e46321dfedaa01b37a9696cb21014.tar.gz
scala-6b9c0247506e46321dfedaa01b37a9696cb21014.tar.bz2
scala-6b9c0247506e46321dfedaa01b37a9696cb21014.zip
implemented #1134, matching on this-identifiers
-rw-r--r--src/compiler/scala/tools/nsc/matching/TransMatcher.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
index b6f9206432..5a17202a78 100644
--- a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
+++ b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
@@ -246,10 +246,14 @@ trait TransMatcher { self: transform.ExplicitOuter =>
case Typed(_, _) =>
pat
+ case This(_) => // Sean's feature request #1134, compiled incorrectly
+ val stpe = mkThisType(pat.tpe.symbol)
+ Typed(Ident(nme.WILDCARD) setType stpe, TypeTree(stpe))
+
//case _ =>
// Console.println(pat);
// Console.println(pat.getClass());
- // scala.Predef.error"( what is this ? ")
+ // scala.Predef.error(" what is this ? ")
}
var res: List[CaseDef] = Nil