summaryrefslogtreecommitdiff
path: root/test/files/run/t8575.scala
blob: fb8f603f3e5932aed0d83e3b6a173e1b129a9056 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class E[F]
class A
class B
class C

trait TypeMember {
  type X

  // This call throws an AbstractMethodError, because it invokes the erasure of
  // consume(X): Unit that is consume(Object): Unit. But the corresponding
  // bridge method is not generated.
  consume(value)

  def value: X
  def consume(x: X): Unit
}

object Test extends TypeMember {
  type F = A with B

  // works if replaced by type X = E[A with B with C]
  type X = E[F with C]

  def value = new E[F with C]

  // This call passes, since it invokes consume(E): Unit
  def consume(x: X) {}

  def main(args: Array[String]) {
    consume(value)
  }
}