Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_init_super_call3.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import kernel
16
17 class A
18 init(i: Int) do i.output
19 end
20
21 class B
22 super A
23 init(i)
24 do
25 super
26 (i+1).output
27 end
28 end
29
30 class C
31 super A
32 init(i)
33 do
34 (i+1).output
35 super
36 end
37 end
38
39 class D
40 super A
41 init(i)
42 is
43 nosuper
44 do
45 (i+1).output
46 end
47 end
48
49 class E
50 super A
51 init(i)
52 do
53 (i+1).output
54 end
55 end
56
57 class F
58 super A
59 redef init(i)
60 do
61 super
62 (i+1).output
63 end
64 end
65
66 class G
67 super A
68 redef init(i)
69 do
70 (i+1).output
71 super
72 end
73 end
74
75 class H
76 super A
77 redef init(i)
78 is
79 nosuper
80 do
81 (i+1).output
82 end
83 end
84
85 class I
86 super A
87 redef init(i)
88 do
89 (i+1).output
90 end
91 end
92
93 var a = new A(10)
94 var b = new B(20)
95 var c = new C(30)
96 var d = new D(40)
97 var e = new E(50)
98 var f = new F(60)
99 var g = new G(70)
100 var h = new H(80)
101 var i = new I(90)