16 lines
295 B
Rust
16 lines
295 B
Rust
|
// -*- rust -*-
|
||
|
|
||
|
type clam[T] = tag(a(T, int), b());
|
||
|
|
||
|
fn uhoh[T](vec[clam[T]] v) {
|
||
|
alt (v.(1)) {
|
||
|
case (a[T](t, u)) { log "incorrect"; log u; fail; }
|
||
|
case (b[T]()) { log "correct"; }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
let vec[clam[int]] v = vec(b[int](), b[int](), a[int](42, 17));
|
||
|
uhoh[int](v);
|
||
|
}
|