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

16 lines
286 B
Rust
Raw Normal View History

// -*- rust -*-
2012-08-01 17:30:05 -07:00
fn some_box(x: int) -> @int { return @x; }
2012-08-01 17:30:05 -07:00
fn is_odd(n: int) -> bool { return true; }
2012-08-01 17:30:05 -07:00
fn length_is_even(vs: @int) -> bool { return true; }
2011-07-27 14:19:39 +02:00
fn foo(acc: int, n: int) {
2012-08-22 17:24:52 -07:00
if is_odd(n) && length_is_even(some_box(1)) { error!("bloop"); }
}
fn main() { foo(67, 5); }