2010-08-12 18:21:08 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2011-08-12 08:37:25 -05:00
|
|
|
tag clam<T> { a(T, int); b; }
|
2010-08-12 18:21:08 -05:00
|
|
|
|
2011-09-12 04:27:30 -05:00
|
|
|
fn uhoh<T>(v: [clam<T>]) {
|
2011-08-19 17:16:48 -05:00
|
|
|
alt v[1] {
|
2011-12-22 19:53:53 -06:00
|
|
|
a::<T>(t, u) { #debug("incorrect"); log(debug, u); fail; }
|
2011-12-22 16:42:52 -06:00
|
|
|
b::<T>. { #debug("correct"); }
|
2011-06-15 13:19:50 -05:00
|
|
|
}
|
2010-08-12 18:21:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-08-19 17:16:48 -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
|
|
|
}
|