blob: 26c27435ce1d8a0b12dd6cc08becde34217fb52a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// xfail-test
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 b: big = big();
assert (b.one() == 1);
assert (b.two() == 2);
assert (b.three() == 3);
let s: small = b as small;
assert (s.one() == 1);
}
|