syntax: 'meth' -> 'fun', 'attr' -> 'var'
[nit.git] / tests / base_init_inherit4.nit
1 import kernel
2
3 redef interface Object
4
5 fun foo
6 do
7 'a'.output
8 '\n'.output
9 end
10 end
11
12 interface M
13 redef fun foo
14 do
15 'm'.output
16 super
17 end
18 end
19
20 class B
21 init cb
22 do
23 'B'.output
24 end
25
26 redef fun foo
27 do
28 'b'.output
29 super
30 end
31 end
32
33 interface N
34 redef fun foo
35 do
36 'n'.output
37 super
38 end
39 end
40
41 class O
42 special M
43 special B
44 redef fun foo
45 do
46 'o'.output
47 super
48 end
49 end
50
51 class P
52 special B
53 special N
54 redef fun foo
55 do
56 'p'.output
57 super
58 end
59 end
60
61 class Q
62 #alt0#special M
63 #alt0#special B
64 #alt0#special N
65
66 #alt1#special O
67 #alt1#special N
68
69 #alt2#special M
70 #alt2#special P
71
72 #alt3#special O
73 #alt3#special P
74 redef fun foo
75 do
76 'q'.output
77 super
78 end
79 end
80
81 (new B.cb).foo
82 (new O.cb).foo
83 (new P.cb).foo
84 (new Q.cb).foo
85