Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_prot_sig.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 class A
17 fun pubA(a: A) do end
18 protected fun proA(a: A) do end
19 private fun priA(a: A) do end
20
21 fun pubA2: A do abort
22 protected fun proA2: A do abort
23 private fun priA2: A do abort
24
25 var vpubA: nullable A is writable, noinit
26 protected var vproA: nullable A is protected writable, noinit
27 private var vpriA: nullable A is noinit
28
29 var vpubA2 = new A is writable
30 protected var vproA2 = new A is protected writable
31 private var vpriA2 = new A
32
33 #alt1#fun pubB(a: B) do end
34 #alt2#protected fun proB(a: B) do end
35 private fun priB(a: B) do end
36
37 #alt1#fun pubB2: B do abort
38 #alt2#protected fun proB2: B do abort
39 private fun priB2: B do abort
40
41 #alt3#var vpubB: nullable B is writable, noinit
42 #alt4#protected var vproB: nullable B is protected writable, noinit
43 private var vpriB: nullable B is noinit
44
45 #alt5#var vpubB2 = new B is writable
46 #alt6#protected var vproB2 = new B is protected writable
47 private var vpriB2 = new B
48
49
50 end
51
52 private class B
53 fun pubA(a: A) do end
54 #alt7#protected fun proA(a: A) do end
55 private fun priA(a: A) do end
56
57 var vpubA: nullable A is writable, noinit
58 #alt7#protected var vproA: nullable A is protected writable, noinit
59 private var vpriA: nullable A is noinit
60
61 var vpubA2 = new A is writable
62 #alt7#protected var vproA2 = new A is protected writable
63 private var vpriA2 = new A
64
65 fun pubB(a: B) do end
66 #alt7#protected fun proB(a: B) do end
67 private fun priB(a: B) do end
68
69 var vpubB: nullable B is writable, noinit
70 #alt7#protected var vproB: nullable B is protected writable, noinit
71 private var vpriB: nullable B is noinit
72
73 var vpubB2 = new B is writable
74 #alt7#protected var vproB2 = new B is protected writable
75 private var vpriB2 = new B
76
77
78 end