aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/t3683-modified.scala
blob: 19b981e0ae3e986af50f3971f21d57736c0fb025 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
sealed trait Foo
sealed trait Bar extends Foo
sealed trait W[T >: Bar <: Foo]
case class X() extends W[Foo]
case class XX() extends W[Bar]
case class Y() extends W[Bar]
case class Z[T >: T <: Foo](               // error: cyclic reference
  z1: W[T]
) extends W[T]

object Main {
  // should warn for not including XX()
  def f1(w: W[Bar]): Int = {
    w match {
      // case XX() => 2
      case Y() => 1
      case Z(z) => f1(z)
    }
  }
}