2011-04-27 16:55:55 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
// a bug was causing this to complain about leaked memory on exit
|
2011-04-27 16:55:55 -05:00
|
|
|
use std;
|
2011-05-12 10:24:54 -05:00
|
|
|
import std::option;
|
|
|
|
import std::option::some;
|
|
|
|
import std::option::none;
|
2011-04-27 16:55:55 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
tag t { foo(int, uint); bar(int, option::t[int]); }
|
2011-04-27 16:55:55 -05:00
|
|
|
|
|
|
|
fn nested(t o) {
|
2011-06-15 13:19:50 -05:00
|
|
|
alt (o) {
|
|
|
|
case (bar(?i, some[int](_))) {
|
|
|
|
log_err "wrong pattern matched";
|
|
|
|
fail;
|
|
|
|
}
|
|
|
|
case (_) { log_err "succeeded"; }
|
2011-04-27 16:55:55 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
fn main() { nested(bar(1, none[int])); }
|