From a4594ddc496cb4599188ce047cf783aa92465288 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 14 Oct 2016 12:25:55 +0200 Subject: Fix #1515: Don't narrow gadt bounds when frozen Fixes #1515. Review by @smarter. --- tests/pos/i1515.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/pos/i1515.scala (limited to 'tests/pos/i1515.scala') 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)) + + } +} -- cgit v1.2.3