aboutsummaryrefslogblamecommitdiff
path: root/tests/neg/tate.scala
blob: acf7ee7e3dbf0f81defa0ff156add620ba0855cf (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                                             
    object unsound {
      trait Bound[A, B <: A]
      trait Bind[A] {
        def bad[B <: A](bound: Bound[A, B], b: B) = b
      }
      def coerce[T, U](t: T): U = {
        lazy val bound: Bound[U, _ >: T] = ??? // error: >: T does not conform to upper bound
        def bind = new Bind[U] {}
        bind.bad(bound, t)
      }
    }