rust/src/test/run-pass/use-uninit-alt.rs

11 lines
178 B
Rust
Raw Normal View History

2011-07-27 07:19:39 -05:00
fn foo[T](o: &myoption[T]) -> int {
let x: int = 5;
alt o { none[T]. { } some[T](t) { x += 1; } }
ret x;
}
tag myoption[T] { none; some(T); }
fn main() { log 5; }