2011-05-03 20:13:51 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2011-07-20 21:37:09 -05:00
|
|
|
// xfail-stage3
|
2010-06-23 23:03:09 -05:00
|
|
|
obj big() {
|
2011-06-15 13:19:50 -05:00
|
|
|
fn one() -> int { ret 1; }
|
|
|
|
fn two() -> int { ret 2; }
|
|
|
|
fn three() -> int { ret 3; }
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
type small =
|
|
|
|
obj {
|
|
|
|
fn one() -> int ;
|
|
|
|
};
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-07-27 07:19:39 -05:00
|
|
|
let b: big = big();
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (b.one() == 1);
|
|
|
|
assert (b.two() == 2);
|
|
|
|
assert (b.three() == 3);
|
2011-07-27 07:19:39 -05:00
|
|
|
let s: small = b as small;
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (s.one() == 1);
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|