about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-02-25 12:37:03 -0800
committerPatrick Walton <pcwalton@mimiga.net>2011-02-25 13:44:08 -0800
commit7a1d01effcfa5763bc62aefba40f67ad2130d28d (patch)
tree2e26bf45352b71d1e618f359bf388beae354fb21 /src/test
parent081c3aa76dd0805767e0233c0cc6ccf313cf44ba (diff)
rustc: Push type parameters down through alt tag patterns; add a test
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/generic-tag-box-alt.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/run-pass/generic-tag-box-alt.rs b/src/test/run-pass/generic-tag-box-alt.rs
new file mode 100644
index 00000000000..2727885a161
--- /dev/null
+++ b/src/test/run-pass/generic-tag-box-alt.rs
@@ -0,0 +1,19 @@
+tag foo[T] {
+  arm(@T);
+}
+
+fn altfoo[T](foo[T] f) {
+  auto hit = false;
+  alt (f) {
+    case (arm[T](?x)) {
+      log "in arm";
+      hit = true;
+    }
+  }
+  check (hit);
+}
+
+fn main() {
+  altfoo[int](arm[int](@10));
+}
+