rust/src/test/run-pass/if-check.rs
2011-07-27 15:54:33 +02:00

10 lines
234 B
Rust

// xfail-stage0
pred even(x: uint) -> bool {
if x < 2u {
ret false;
} else if (x == 2u) { ret true; } else { ret even(x - 2u); }
}
fn foo(x: uint) { if check even(x) { log x; } else { fail; } }
fn main() { foo(2u); }