tests: add base_prot_sig to test usage of private type in public signature
[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 var vpubA: nullable A writable
22 protected var vproA: nullable A protected writable
23 private var vpriA: nullable A
24
25 var vpubA2 writable = new A
26 protected var vproA2 protected writable = new A
27 private var vpriA2 = new A
28
29 #alt1#fun pubB(a: B) do end
30 #alt2#protected fun proB(a: B) do end
31 private fun priB(a: B) do end
32
33 #alt3#var vpubB: nullable B writable
34 #alt4#protected var vproB: nullable B protected writable
35 private var vpriB: nullable B
36
37 #alt5#var vpubB2 writable = new B
38 #alt6#protected var vproB2 protected writable = new B
39 private var vpriB2 = new B
40
41 init do end
42 end
43
44 private class B
45 fun pubA(a: A) do end
46 #alt7#protected fun proA(a: A) do end
47 private fun priA(a: A) do end
48
49 var vpubA: nullable A writable
50 #alt7#protected var vproA: nullable A protected writable
51 private var vpriA: nullable A
52
53 var vpubA2 writable = new A
54 #alt7#protected var vproA2 protected writable = new A
55 private var vpriA2 = new A
56
57 fun pubB(a: B) do end
58 #alt7#protected fun proB(a: B) do end
59 private fun priB(a: B) do end
60
61 var vpubB: nullable B writable
62 #alt7#protected var vproB: nullable B protected writable
63 private var vpriB: nullable B
64
65 var vpubB2 writable = new B
66 #alt7#protected var vproB2 protected writable = new B
67 private var vpriB2 = new B
68
69 init do end
70 end