blob: 8e7636aaac692b40471af9cef5537b668f1dfa9c (
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)
}
trait B extends A[Int] {
def foo(t: Int) {
println("B.foo")
}
}
trait M extends B {
abstract override def foo(t: Int) {
super.foo(t)
println("M.foo")
}
}
object C extends B with M
object D extends B {
override def foo(t: Int) {
super.foo(t)
println("M.foo")
}
}
object Test {
def main(args: Array[String]) {
D.foo(42) // OK, prints B.foo M.foo
C.foo(42) // was StackOverflowError
}
}
|