aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-02-25 12:37:03 -0800
committerPatrick Walton <[email protected]>2011-02-25 13:44:08 -0800
commit7a1d01effcfa5763bc62aefba40f67ad2130d28d (patch)
tree2e26bf45352b71d1e618f359bf388beae354fb21 /src/test/run-pass
parentPass the abi of native functions all the way to codegen. (diff)
downloadrust-7a1d01effcfa5763bc62aefba40f67ad2130d28d.tar.xz
rust-7a1d01effcfa5763bc62aefba40f67ad2130d28d.zip
rustc: Push type parameters down through alt tag patterns; add a test
Diffstat (limited to 'src/test/run-pass')
-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 00000000..2727885a
--- /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));
+}
+