summary refs log tree commit diff
path: root/src/test/run-pass/box-pattern.rs
blob: 90228f3dcf25ebaa6fcfeec8e6e96780f71f6a77 (plain)
1
2
3
4
5
6
7
8
9
type foo = {a: int, b: uint};
enum bar { u(@foo), w(int), }

fn main() {
    assert (match u(@{a: 10, b: 40u}) {
              u(@{a: a, b: b}) => { a + (b as int) }
              _ => { 66 }
            } == 50);
}