aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-07-28 15:04:58 -0700
committerRoy Frostig <[email protected]>2010-07-28 15:04:58 -0700
commitf282c5ccc001ba377dfeee6f347ef56b73c86f4e (patch)
treeeced775abd1683c9a531e4a57f24544cad3f02e1 /src/test
parentRefer to issue #136 at the offending source point. (diff)
downloadrust-f282c5ccc001ba377dfeee6f347ef56b73c86f4e.tar.xz
rust-f282c5ccc001ba377dfeee6f347ef56b73c86f4e.zip
Get slots in trans_tag using Semant tables. Closes #133.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/generic-tag-values.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/run-pass/generic-tag-values.rs b/src/test/run-pass/generic-tag-values.rs
new file mode 100644
index 00000000..19916f07
--- /dev/null
+++ b/src/test/run-pass/generic-tag-values.rs
@@ -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);
+ }
+ }
+}