2011-11-18 05:39:20 -06:00
|
|
|
fn double<copy T>(a: T) -> [T] { ret [a] + [a]; }
|
2011-07-08 13:29:29 -05:00
|
|
|
|
2011-08-19 17:16:48 -05:00
|
|
|
fn double_int(a: int) -> [int] { ret [a] + [a]; }
|
2011-07-08 13:29:29 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-07-27 07:19:39 -05:00
|
|
|
let d = double(1);
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (d[0] == 1);
|
|
|
|
assert (d[1] == 1);
|
2011-07-08 13:29:29 -05:00
|
|
|
|
|
|
|
d = double_int(1);
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (d[0] == 1);
|
|
|
|
assert (d[1] == 1);
|
2011-07-08 13:29:29 -05:00
|
|
|
}
|
|
|
|
|