rust/src/test/run-pass/block-arg-in-ternary.rs

7 lines
195 B
Rust
Raw Normal View History

2011-12-29 09:49:33 -08:00
// Allow block arguments with ternary... why not, no chance of ambig.
fn main() {
let v = [-1f, 1f];
2012-01-05 14:46:14 +01:00
let foo = vec::any(v) { |e| float::is_negative(e) } ? true : false;
2011-12-29 09:49:33 -08:00
assert foo;
}