Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_test_variadic.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # This file is free software, which comes along with NIT. This software is
4 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
5 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
6 # PARTICULAR PURPOSE. You can modify it if you want, provided this header
7 # is kept unaltered, and a notification of the changes is added.
8 # You are allowed to redistribute it and sell it, alone or as a part of
9 # another product.
10
11 import kernel
12 import array
13
14 class A
15
16 fun variadic(b: Discrete...)
17 do
18 b[0].output
19 b[1].output
20 b[2].output
21 end
22
23 end
24
25 class B
26 super A
27
28 redef fun variadic(b: Discrete...)
29 do
30 super
31 end
32 end
33
34 (new A).variadic(1,2,3)
35 (new B).variadic(4,5,6)