2012-06-19 14:00:09 -05:00
|
|
|
fn main() {
|
|
|
|
|
2012-08-15 20:46:55 -05:00
|
|
|
struct b {
|
2012-06-19 14:00:09 -05:00
|
|
|
let i: int;
|
2012-08-01 19:30:05 -05:00
|
|
|
fn do_stuff() -> int { return 37; }
|
2012-06-19 14:00:09 -05:00
|
|
|
}
|
|
|
|
|
2012-09-05 17:58:43 -05:00
|
|
|
fn b(i:int) -> b {
|
|
|
|
b {
|
|
|
|
i: i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-19 14:00:09 -05:00
|
|
|
// fn b(x:int) -> int { fail; }
|
|
|
|
|
|
|
|
let z = b(42);
|
|
|
|
assert(z.i == 42);
|
|
|
|
assert(z.do_stuff() == 37);
|
|
|
|
|
|
|
|
}
|