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