2011-03-25 14:19:20 -05:00
|
|
|
// xfail-boot
|
|
|
|
// xfail-boot
|
|
|
|
// xfail-stage0
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
obj big() {
|
|
|
|
fn one() -> int { ret 1; }
|
|
|
|
fn two() -> int { ret 2; }
|
|
|
|
fn three() -> int { ret 3; }
|
|
|
|
}
|
|
|
|
|
|
|
|
type small = obj {
|
|
|
|
fn one() -> int;
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
let big b = big();
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (b.one() == 1);
|
|
|
|
assert (b.two() == 2);
|
|
|
|
assert (b.three() == 3);
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
let small s = b as small;
|
2011-05-02 19:47:24 -05:00
|
|
|
assert (s.one() == 1);
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|