summaryrefslogtreecommitdiff
path: root/test/files/neg/gadts1.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-30 17:57:15 +0000
committerPaul Phillips <paulp@improving.org>2010-11-30 17:57:15 +0000
commit51e4a6a351a64a1bff995e1b5fefb88c7e2430eb (patch)
tree4253b1cd295417b235de10df0484861397c4eaec /test/files/neg/gadts1.scala
parent81f38907b838caa64d26b4ea49efe938a3d0673f (diff)
downloadscala-51e4a6a351a64a1bff995e1b5fefb88c7e2430eb.tar.gz
scala-51e4a6a351a64a1bff995e1b5fefb88c7e2430eb.tar.bz2
scala-51e4a6a351a64a1bff995e1b5fefb88c7e2430eb.zip
Parser relaxation so that one can name the type...
Parser relaxation so that one can name the type variables in a constructor pattern match: this is a prerequisite to realizing the full potential of gadts. (Nothing new works here however.) No review.
Diffstat (limited to 'test/files/neg/gadts1.scala')
-rw-r--r--test/files/neg/gadts1.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/files/neg/gadts1.scala b/test/files/neg/gadts1.scala
index 07200ff7aa..08403e6eec 100644
--- a/test/files/neg/gadts1.scala
+++ b/test/files/neg/gadts1.scala
@@ -10,10 +10,16 @@ case class NumTerm(val n: Number) extends Term[Number]
class IntTerm(n: Int) extends NumTerm(n) with Term[Int]
-def f[a](t:Term[a], c:Cell[a]): Unit =
+def f[a](t:Term[a], c:Cell[a]): Unit = {
t match {
case NumTerm(n) => c.x = Double(1.0)
}
+ t match {
+ // presently testing that this gets past the parser: eventually
+ // it should actually work.
+ case Cell[a](x: Int) => c.x = 5
+ }
+}
val x:Term[Number] = NumTerm(Int(5))