aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/obj-as.rs
blob: 6e0dac37b8fe62f3708323192c7430a6a5dae552 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// xfail-boot
// xfail-boot
// xfail-stage0

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();
  check (b.one() == 1);
  check (b.two() == 2);
  check (b.three() == 3);

  let small s = b as small;
  check (s.one() == 1);
}