Get slots in trans_tag using Semant tables. Closes #133.

This commit is contained in:
Roy Frostig 2010-07-28 15:04:58 -07:00
parent a9ad2e98e3
commit f282c5ccc0
3 changed files with 34 additions and 5 deletions

View file

@ -0,0 +1,23 @@
// -*- rust -*-
type noption[T] = tag(some(T));
fn main() {
let noption[int] nop = some[int](5);
alt (nop) {
case (some[int](n)) {
log n;
check (n == 5);
}
}
let noption[tup(int, int)] nop2 = some[tup(int, int)](tup(17, 42));
alt (nop2) {
case (some[tup(int, int)](t)) {
log t._0;
log t._1;
check (t._0 == 17);
check (t._1 == 42);
}
}
}