2010-08-12 16:21:08 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2011-08-12 06:37:25 -07:00
|
|
|
tag 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-08-13 00:10:18 -07:00
|
|
|
a::<T>(t, u) { log "incorrect"; log u; fail; }
|
|
|
|
b::<T>. { log "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
|
|
|
}
|