summary refs log tree commit diff
path: root/src/test/run-pass/nested-pattern.rs
blob: a712f1c45e680b720cedc3af07184ba43b415b51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17


// a bug was causing this to complain about leaked memory on exit
extern mod std;
use option::Some;
use option::None;

enum t { foo(int, uint), bar(int, Option<int>), }

fn nested(o: t) {
    match o {
      bar(i, Some::<int>(_)) => { error!("wrong pattern matched"); fail; }
      _ => { error!("succeeded"); }
    }
}

fn main() { nested(bar(1, None::<int>)); }