Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_attr_abstract4.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 core::kernel
16
17 interface A
18 var i: Int is abstract
19 fun j: Int is abstract
20 fun j=(o: Int) is abstract
21 end
22
23 class B
24 super A
25 var k: Int is abstract
26 fun l: Int is abstract
27 fun l=(o: Int) is abstract
28 end
29
30 class C
31 super B
32 redef fun i do
33 'i'.output
34 return 1
35 end
36 redef fun i=(o) do
37 'i'.output
38 '='.output
39 o.output
40 end
41 redef fun j do
42 'j'.output
43 return 2
44 end
45 redef fun j=(o) do
46 'j'.output
47 '='.output
48 o.output
49 end
50 redef fun k do
51 'k'.output
52 return 3
53 end
54 redef fun k=(o)
55 do
56 'k'.output
57 '='.output
58 o.output
59 end
60 redef fun l do
61 'l'.output
62 return 4
63 end
64 redef fun l=(o) do
65 'l'.output
66 '='.output
67 o.output
68 end
69 end
70
71 var c = new C
72 c.i.output
73 c.j.output
74 c.k.output
75 c.l.output