Get slots in trans_tag using Semant tables. Closes #133.
This commit is contained in:
parent
a9ad2e98e3
commit
f282c5ccc0
3 changed files with 34 additions and 5 deletions
23
src/test/run-pass/generic-tag-values.rs
Normal file
23
src/test/run-pass/generic-tag-values.rs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue