2010-08-12 18:21:08 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2010-09-09 17:59:29 -05:00
|
|
|
tag clam[T] {
|
|
|
|
a(T, int);
|
2010-09-21 01:56:43 -05:00
|
|
|
b;
|
2010-09-09 17:59:29 -05:00
|
|
|
}
|
2010-08-12 18:21:08 -05:00
|
|
|
|
|
|
|
fn uhoh[T](vec[clam[T]] v) {
|
|
|
|
alt (v.(1)) {
|
2010-09-21 01:56:43 -05:00
|
|
|
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-05-16 20:21:22 -05:00
|
|
|
let vec[clam[int]] v = [b[int], b[int], a[int](42, 17)];
|
2010-08-12 18:21:08 -05:00
|
|
|
uhoh[int](v);
|
|
|
|
}
|