summary refs log tree commit diff
path: root/src/test/run-pass/private-method.rs
blob: a6c1929dc1f0ad5d039c8853777e628034169a63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class cat {
  priv {
    let mut meows : uint;
      fn nap() { for uint::range(1u, 10u) |_i| { }}
  }

  let how_hungry : int;

  fn play() {
    self.meows += 1u;
    self.nap();
  }
  new(in_x : uint, in_y : int) { self.meows = in_x; self.how_hungry = in_y; }
}

fn main() {
  let nyan : cat = cat(52u, 99);
  nyan.play();
}