Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / syntax_annotations3.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 class Account
16 invariant solde > 0
17
18 fun toto(i: Int): Int is
19 pre i >= 0
20 post result == i + 1
21 test toto(5) == 6
22 do
23 return i + 1
24 end
25
26 fun stop
27 is
28 inter
29 do
30 abort
31 end
32
33 var tata: Int@u32 is
34 ondebug(@daemon@after(print(toto)))
35 final
36 end
37
38 var titi = 5 is writable, readable, initable, fast_init
39
40 var x = new HashMap[String, Object] is lazy
41
42 type T: Object is unchecked
43 end