rust/src/test/run-pass/nullary-or-pattern.rs
2012-08-06 15:36:30 -07:00

11 lines
156 B
Rust

enum blah { a, b, }
fn or_alt(q: blah) -> int {
match q { a | b => { 42 } }
}
fn main() {
assert (or_alt(a) == 42);
assert (or_alt(b) == 42);
}