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