aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2014-12-19 14:15:59 +0100
committerodersky <odersky@gmail.com>2014-12-19 14:15:59 +0100
commit13ec91b955b5c10da750b26e10f793ea44a72945 (patch)
treecdf6a5e87d563fd60d9230f89d5211c99582940c /tests
parentf3c0eaa2a2e02e3bd832bf9d30bc7f8e3397ef88 (diff)
parent009a1e69e7bdc3df1b085d2271042607c83b1e82 (diff)
downloaddotty-13ec91b955b5c10da750b26e10f793ea44a72945.tar.gz
dotty-13ec91b955b5c10da750b26e10f793ea44a72945.tar.bz2
dotty-13ec91b955b5c10da750b26e10f793ea44a72945.zip
Merge pull request #271 from dotty-staging/fix/i268-gadts
Fixed #264 - failure to typecheck GADTs
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i0268.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pos/i0268.scala b/tests/pos/i0268.scala
new file mode 100644
index 000000000..6ac0c5c90
--- /dev/null
+++ b/tests/pos/i0268.scala
@@ -0,0 +1,15 @@
+package typespatmat
+
+sealed trait Box2[T]
+final case class Int2(x: Int) extends Box2[Int]
+final case class Str2(x: String)
+ extends Box2[String]
+final case class Gen[T](x: T) extends Box2[T]
+
+object Box2 {
+ def double2[T](x: Box2[T]): T = x match {
+ case Int2(i) => i * 2
+ case Str2(s) => s + s
+ case Gen(x) => x
+ }
+}