From 7a1d01effcfa5763bc62aefba40f67ad2130d28d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 25 Feb 2011 12:37:03 -0800 Subject: rustc: Push type parameters down through alt tag patterns; add a test --- src/test/run-pass/generic-tag-box-alt.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/run-pass/generic-tag-box-alt.rs (limited to 'src/test') 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)); +} + -- cgit v1.2.3