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