diff --git a/tests/pos/i7068-a.scala b/tests/pos/i7068-a.scala new file mode 100644 index 000000000000..577403f045d6 --- /dev/null +++ b/tests/pos/i7068-a.scala @@ -0,0 +1,14 @@ +sealed trait Foo[T] { + def foo(s: Foo[T]): Nothing +} + +inline def species[T](t: T) = { + case class FooT(x: T) extends Foo[T] { + def foo(s: Foo[T]) = s match { + case FooT(x) => ??? + } + } + FooT(t) +} + +val foo = species(0) diff --git a/tests/pos/i7068-b.scala b/tests/pos/i7068-b.scala new file mode 100644 index 000000000000..fcb24df9e140 --- /dev/null +++ b/tests/pos/i7068-b.scala @@ -0,0 +1,5 @@ +inline def species() = { + case class FooT() + FooT() +} +val foo = species()