blob: 2d67bc2678547d8a37129cff372d0da35f3f4926 [file] [log] [blame]
Tim Chevalierf3343b32012-02-01 03:30:401// xfail-test
2class cat {
3 priv {
4 let mutable meows : uint;
5 fn meow() {
6 #error("Meow");
7 meows += 1;
8 if meows % 5 == 0 {
9 how_hungry += 1;
10 }
11 }
12 }
13
14 let how_hungry : int;
15
16 new(in_x : uint, in_y : int) { meows = in_x; how_hungry = in_y; }
17
18 fn speak() { meow(); }
19
20 fn eat() {
21 if how_hungry > 0 {
22 #error("OM NOM NOM");
23 how_hungry -= 2;
24 }
25 else {
26 #error("Not hungry!");
27 }
28 }
29}