rust/src/test/run-pass/box-pattern.rs

9 lines
206 B
Rust
Raw Normal View History

2011-07-27 12:19:39 +00:00
type foo = {a: int, b: uint};
tag bar { u(@foo); w(int); }
fn main() {
2011-07-27 12:19:39 +00:00
assert (alt u(@{a: 10, b: 40u}) {
u(@{a: a, b: b}) { a + (b as int) }
_ { 66 }
} == 50);
}