aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i1515.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-10-14 12:25:55 +0200
committerMartin Odersky <odersky@gmail.com>2016-10-14 12:25:55 +0200
commita4594ddc496cb4599188ce047cf783aa92465288 (patch)
treedbfc5cdd83202c566603121b175b093dbf4b2acd /tests/pos/i1515.scala
parent8bfaadaae141e83db7f515b042fcee26ed0e54fd (diff)
downloaddotty-a4594ddc496cb4599188ce047cf783aa92465288.tar.gz
dotty-a4594ddc496cb4599188ce047cf783aa92465288.tar.bz2
dotty-a4594ddc496cb4599188ce047cf783aa92465288.zip
Fix #1515: Don't narrow gadt bounds when frozen
Fixes #1515. Review by @smarter.
Diffstat (limited to 'tests/pos/i1515.scala')
-rw-r--r--tests/pos/i1515.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/pos/i1515.scala b/tests/pos/i1515.scala
new file mode 100644
index 000000000..fb3ad78ee
--- /dev/null
+++ b/tests/pos/i1515.scala
@@ -0,0 +1,16 @@
+sealed trait Trait[T]
+
+final case class Case[T](e: T) extends Trait[T]
+
+object Demo {
+ def main(args: Array[String]): Unit = {
+
+ def f[H](t: Trait[H]): Unit =
+ t match {
+ case Case(e) => println(Some(e))
+ }
+
+ f(Case(1))
+
+ }
+}