aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t4996.scala
blob: e8ef5949cbe4d983484e3e15d140065e94f9650f (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
trait A[@specialized(Int) T] {
  def foo(t: T): Unit
}


trait B extends A[Int] {
  def foo(t: Int): Unit = {
    println("B.foo")
  }
}


trait M extends B {
  abstract override def foo(t: Int): Unit = {
    super.foo(t)
    println("M.foo")
  }
}


object C extends B with M


object D extends B {
  override def foo(t: Int): Unit = {
    super.foo(t)
    println("M.foo")
  }
}


object Test {

  def main(args: Array[String]): Unit = {
    D.foo(42) // OK, prints B.foo M.foo
    C.foo(42) // was StackOverflowError
  }

}