2010-08-12 16:21:08 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
|
|
|
tag clam[T] { a(T, int); b; }
|
2010-08-12 16:21:08 -07:00
|
|
|
|
2011-07-27 14:19:39 +02:00
|
|
|
fn uhoh[T](v: vec[clam[T]]) {
|
|
|
|
alt v.(1) {
|
|
|
|
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-07-27 14:19:39 +02:00
|
|
|
let v: vec[clam[int]] = [b[int], b[int], a[int](42, 17)];
|
2011-06-15 11:19:50 -07:00
|
|
|
uhoh[int](v);
|
|
|
|
}
|