2010-08-12 16:21:08 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2012-01-19 18:31:08 -08:00
|
|
|
enum clam<T> { a(T, int), b, }
|
2010-08-12 16:21:08 -07:00
|
|
|
|
2011-09-12 11:27:30 +02:00
|
|
|
fn uhoh<T>(v: [clam<T>]) {
|
2011-08-19 15:16:48 -07:00
|
|
|
alt v[1] {
|
2011-12-22 17:53:53 -08:00
|
|
|
a::<T>(t, u) { #debug("incorrect"); log(debug, u); fail; }
|
2012-01-19 01:03:57 -08:00
|
|
|
b::<T> { #debug("correct"); }
|
2011-06-15 11:19:50 -07:00
|
|
|
}
|
2010-08-12 16:21:08 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-08-19 15:16:48 -07:00
|
|
|
let v: [clam<int>] = [b::<int>, b::<int>, a::<int>(42, 17)];
|
2011-08-13 00:10:18 -07:00
|
|
|
uhoh::<int>(v);
|
2011-08-10 09:27:22 -07:00
|
|
|
}
|