2011-04-27 14:55:55 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
// a bug was causing this to complain about leaked memory on exit
|
2011-04-27 14:55:55 -07:00
|
|
|
use std;
|
2011-05-12 17:24:54 +02:00
|
|
|
import std::option;
|
|
|
|
import std::option::some;
|
|
|
|
import std::option::none;
|
2011-04-27 14:55:55 -07:00
|
|
|
|
2011-08-10 09:27:22 -07:00
|
|
|
tag t { foo(int, uint); bar(int, option::t<int>); }
|
2011-04-27 14:55:55 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn nested(o: t) {
|
|
|
|
alt o {
|
2011-08-13 00:10:18 -07:00
|
|
|
bar(i, some::<int>(_)) { log_err "wrong pattern matched"; fail; }
|
2011-07-27 14:19:39 +02:00
|
|
|
_ { log_err "succeeded"; }
|
2011-04-27 14:55:55 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-13 00:10:18 -07:00
|
|
|
fn main() { nested(bar(1, none::<int>)); }
|