File tree Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change 1+ a
2+ b
3+ b
4+ c
5+ a
6+ b
7+ b
8+ c
9+ a
10+ b
11+ b
12+ c
13+ a
14+ b
15+ b
16+ c
Original file line number Diff line number Diff line change 1+ class A {
2+ def m = " a"
3+ protected def n = " a"
4+ }
5+
6+ trait B {
7+ def m = " b"
8+ protected def n = " b"
9+ }
10+
11+ class C extends A with B {
12+ override def m = " c"
13+ override protected def n = " c"
14+
15+ val f1 = () => super [A ].m
16+ val f2 = () => super [B ].m
17+ val f3 = () => super .m
18+ val f4 = () => this .m
19+
20+ val g1 = new runtime.AbstractFunction0 [String ] { def apply () = C .super [A ].m }
21+ val g2 = new runtime.AbstractFunction0 [String ] { def apply () = C .super [B ].m }
22+ val g3 = new runtime.AbstractFunction0 [String ] { def apply () = C .super .m }
23+ val g4 = new runtime.AbstractFunction0 [String ] { def apply () = C .this .m }
24+
25+ val h1 = () => super [A ].n
26+ val h2 = () => super [B ].n
27+ val h3 = () => super .n
28+ val h4 = () => this .n
29+
30+ val i1 = new runtime.AbstractFunction0 [String ] { def apply () = C .super [A ].n }
31+ val i2 = new runtime.AbstractFunction0 [String ] { def apply () = C .super [B ].n }
32+ val i3 = new runtime.AbstractFunction0 [String ] { def apply () = C .super .n }
33+ val i4 = new runtime.AbstractFunction0 [String ] { def apply () = C .this .n }
34+ }
35+
36+ object Test extends App {
37+ val c = new C
38+ println(c.f1())
39+ println(c.f2())
40+ println(c.f3())
41+ println(c.f4())
42+
43+ println(c.g1())
44+ println(c.g2())
45+ println(c.g3())
46+ println(c.g4())
47+
48+ println(c.h1())
49+ println(c.h2())
50+ println(c.h3())
51+ println(c.h4())
52+
53+ println(c.i1())
54+ println(c.i2())
55+ println(c.i3())
56+ println(c.i4())
57+ }
You can’t perform that action at this time.
0 commit comments