rust/src/test/run-pass/box-inside-if.rs

16 lines
277 B
Rust
Raw Normal View History

// -*- rust -*-
fn some_box(x: int) -> @int { ret @x; }
2011-07-27 07:19:39 -05:00
fn is_odd(n: int) -> bool { ret true; }
fn length_is_even(vs: @int) -> bool { ret true; }
2011-07-27 07:19:39 -05:00
fn foo(acc: int, n: int) {
if is_odd(n) && length_is_even(some_box(1)) { error!{"bloop"}; }
}
fn main() { foo(67, 5); }