summary refs log tree commit diff
path: root/src/test/run-pass/classes-simple.rs
blob: ae37fb9a9979841cc581f3ac6c2ce863c403e1e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class cat {
  priv {
    let mut meows : uint;
  }

  let how_hungry : int;

  new(in_x : uint, in_y : int) { self.meows = in_x; self.how_hungry = in_y; }
}

fn main() {
  let nyan : cat = cat(52u, 99);
  let kitty = cat(1000u, 2);
  assert(nyan.how_hungry == 99);
  assert(kitty.how_hungry == 2);
}