rust/src/test/run-pass/expr-elseif-ref.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

8 lines
225 B
Rust

// Make sure we drop the refs of the temporaries needed to return the
// values from the else if branch
fn main() {
let y: @uint = @10u;
let x = if false { y } else if true { y } else { y };
assert (*y == 10u);
}