2010-08-12 18:21:08 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2012-01-19 20:31:08 -06:00
|
|
|
enum clam<T> { a(T, int), b, }
|
2010-08-12 18:21:08 -05:00
|
|
|
|
2012-06-29 18:26:56 -05:00
|
|
|
fn uhoh<T>(v: ~[clam<T>]) {
|
2012-08-06 14:34:08 -05:00
|
|
|
match v[1] {
|
2012-08-22 19:24:52 -05:00
|
|
|
a::<T>(t, u) => { debug!("incorrect"); log(debug, u); fail; }
|
|
|
|
b::<T> => { debug!("correct"); }
|
2011-06-15 13:19:50 -05:00
|
|
|
}
|
2010-08-12 18:21:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-29 18:26:56 -05:00
|
|
|
let v: ~[clam<int>] = ~[b::<int>, b::<int>, a::<int>(42, 17)];
|
2011-08-13 02:10:18 -05:00
|
|
|
uhoh::<int>(v);
|
2011-08-10 11:27:22 -05:00
|
|
|
}
|