2010-08-12 18:21:08 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
|
|
|
tag clam[T] { a(T, int); b; }
|
2010-08-12 18:21:08 -05:00
|
|
|
|
2011-08-12 17:42:39 -05:00
|
|
|
fn uhoh[T](v: &[clam[T]]) {
|
2011-07-27 07:19:39 -05:00
|
|
|
alt v.(1) {
|
|
|
|
a[T](t, u) { log "incorrect"; log u; fail; }
|
|
|
|
b[T]. { log "correct"; }
|
2011-06-15 13:19:50 -05:00
|
|
|
}
|
2010-08-12 18:21:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-08-12 17:42:39 -05:00
|
|
|
let v: [clam[int]] = ~[b[int], b[int], a[int](42, 17)];
|
2011-06-15 13:19:50 -05:00
|
|
|
uhoh[int](v);
|
|
|
|
}
|