2011-06-15 16:23:17 -07:00
|
|
|
// xfail-stage0
|
2011-07-27 14:19:39 +02:00
|
|
|
pred even(x: uint) -> bool {
|
|
|
|
if x < 2u {
|
|
|
|
ret false;
|
|
|
|
} else if (x == 2u) { ret true; } else { ret even(x - 2u); }
|
2011-06-16 11:56:34 -07:00
|
|
|
}
|
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn foo(x: uint) { if check even(x) { log x; } else { fail; } }
|
2011-06-15 16:23:17 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn main() { foo(2u); }
|