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
|
|
|
|
|
|
|
fn uhoh[T](vec[clam[T]] v) {
|
2011-06-15 13:19:50 -05:00
|
|
|
alt (v.(1)) {
|
|
|
|
case (a[T](?t, ?u)) { log "incorrect"; log u; fail; }
|
|
|
|
case (b[T]) { log "correct"; }
|
|
|
|
}
|
2010-08-12 18:21:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-06-15 13:19:50 -05:00
|
|
|
let vec[clam[int]] v = [b[int], b[int], a[int](42, 17)];
|
|
|
|
uhoh[int](v);
|
|
|
|
}
|