Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / error_toplevel.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 import kernel
15
16 redef class Object
17 fun baz do
18 output
19 end
20
21 fun foo1
22 do
23 bar(1)
24 bar(self)
25 #alt1#3.bar(3)
26
27 5.baz
28 baz
29 end
30 end
31
32 fun foo2
33 do
34 bar(10)
35 #alt2#self.bar(20)
36 #alt3#bar(self)
37 #alt4#4.bar(40)
38
39 50.baz
40 #alt5#baz
41 end
42
43 fun bar(o: Object)
44 do
45 o.output
46 end
47
48 redef class Sys
49 redef fun output do 'S'.output
50 end
51
52 0.foo1
53 foo2