test/files/pos/pattern_relative_types.scala:
trait Outer[O] {
case class C[T <: O](x: T, y: Outer.this.type)
}
object Foo extends Outer[String]
class Tst {
val c = new Foo.C("a", Foo)
c match {
case Foo.C(a, o) => a
}
}
$ scalac test/files/pos/pattern_relative_types.scala
test/files/pos/pattern_relative_types.scala:8: error: inferred type arguments [String] do not conform to class C's type parameter bounds [T <: O]
val c = new Foo.C("a", Foo)
^
test/files/pos/pattern_relative_types.scala:8: error: type mismatch;
found : String("a")
required: T
val c = new Foo.C("a", Foo)
^
two errors found