syntax: 'meth' -> 'fun', 'attr' -> 'var'
[nit.git] / tests / rterror_cov_param.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Copyright 2006-2008 Jean Privat <jean@pryen.org>
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 import kernel
18 class A
19 fun bar(a: Object)
20 do
21 a.output
22 end
23 redef fun output
24 do
25 'A'.output
26 end
27
28 fun ret_test
29 # see rterror_cov_ret
30 do
31 ret.output
32 end
33 fun ret: A
34 do
35 return self
36 end
37
38 init do end
39 end
40
41 class B
42 special A
43 redef fun bar(a: B)
44 do
45 a.output
46 end
47 redef fun output
48 do
49 'B'.output
50 end
51 redef fun ret: B
52 do
53 return self
54 end
55
56 init do end
57 end
58
59 var a = new A
60 var b = a
61 b = new B
62 b.bar(5)