diff options
author | Martin Odersky <odersky@gmail.com> | 2016-11-23 13:22:44 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-11-24 14:44:57 +0100 |
commit | a911a701e775b5151bc146dc221745110f304057 (patch) | |
tree | 9cc2674ac3108d38705bec31c5ae3a1979f81332 /tests | |
parent | 3599c243c86ae0a926ef45a435d38b7878dc322f (diff) | |
download | dotty-a911a701e775b5151bc146dc221745110f304057.tar.gz dotty-a911a701e775b5151bc146dc221745110f304057.tar.bz2 dotty-a911a701e775b5151bc146dc221745110f304057.zip |
Enable GADT matching for pattern values
So far, only typed patterns an dunapply had GADT matching.
i1737.scala shows that we need to do the same thing for objects.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/i1737.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pos/i1737.scala b/tests/pos/i1737.scala new file mode 100644 index 000000000..e7b428717 --- /dev/null +++ b/tests/pos/i1737.scala @@ -0,0 +1,11 @@ +object Test { + sealed trait Foo[A] + case object FooI extends Foo[Int] + case class FooS(b: Boolean) extends Foo[String] + + def algFoo[A](foo: Foo[A]): A = + foo match { + case FooI => 42 + case FooS(b) => "foo" + } +} |