2010-06-24 15:32:59 -05:00
|
|
|
|
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn ret_int_i() -> int { ret 10; }
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn ret_ext_i() -> @int { ret @10; }
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn ret_int_rec() -> {a: int, b: int} { ret {a: 10, b: 10}; }
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn ret_ext_rec() -> @{a: int, b: int} { ret @{a: 10, b: 10}; }
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn ret_ext_mem() -> {a: @int, b: @int} { ret {a: @10, b: @10}; }
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn ret_ext_ext_mem() -> @{a: @int, b: @int} { ret @{a: @10, b: @10}; }
|
2010-06-24 15:32:59 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-07-27 07:19:39 -05:00
|
|
|
let int_i: int;
|
|
|
|
let ext_i: @int;
|
|
|
|
let int_rec: {a: int, b: int};
|
|
|
|
let ext_rec: @{a: int, b: int};
|
|
|
|
let ext_mem: {a: @int, b: @int};
|
|
|
|
let ext_ext_mem: @{a: @int, b: @int};
|
2011-06-15 13:19:50 -05:00
|
|
|
int_i = ret_int_i(); // initializing
|
|
|
|
|
|
|
|
int_i = ret_int_i(); // non-initializing
|
|
|
|
|
|
|
|
int_i = ret_int_i(); // non-initializing
|
|
|
|
|
|
|
|
ext_i = ret_ext_i(); // initializing
|
|
|
|
|
|
|
|
ext_i = ret_ext_i(); // non-initializing
|
|
|
|
|
|
|
|
ext_i = ret_ext_i(); // non-initializing
|
|
|
|
|
2011-07-26 07:49:40 -05:00
|
|
|
int_rec = ret_int_rec(); // initializing
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2011-07-26 07:49:40 -05:00
|
|
|
int_rec = ret_int_rec(); // non-initializing
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2011-07-26 07:49:40 -05:00
|
|
|
int_rec = ret_int_rec(); // non-initializing
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2011-07-26 07:49:40 -05:00
|
|
|
ext_rec = ret_ext_rec(); // initializing
|
2011-06-15 13:19:50 -05:00
|
|
|
|
2011-07-26 07:49:40 -05:00
|
|
|
ext_rec = ret_ext_rec(); // non-initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-07-26 07:49:40 -05:00
|
|
|
ext_rec = ret_ext_rec(); // non-initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
ext_mem = ret_ext_mem(); // initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
ext_mem = ret_ext_mem(); // non-initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
ext_mem = ret_ext_mem(); // non-initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
ext_ext_mem = ret_ext_ext_mem(); // initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
ext_ext_mem = ret_ext_ext_mem(); // non-initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
ext_ext_mem = ret_ext_ext_mem(); // non-initializing
|
2010-06-24 15:32:59 -05:00
|
|
|
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|