rust/src/test/run-pass/nullary-or-pattern.rs

11 lines
154 B
Rust
Raw Normal View History

enum blah { a, b, }
fn or_alt(q: blah) -> int {
2012-08-03 21:59:04 -05:00
alt q { a | b => { 42 } }
}
fn main() {
assert (or_alt(a) == 42);
assert (or_alt(b) == 42);
}