aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/generic-exterior-box.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/run-pass/generic-exterior-box.rs')
-rw-r--r--src/test/run-pass/generic-exterior-box.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/run-pass/generic-exterior-box.rs b/src/test/run-pass/generic-exterior-box.rs
new file mode 100644
index 00000000..797b0f6f
--- /dev/null
+++ b/src/test/run-pass/generic-exterior-box.rs
@@ -0,0 +1,13 @@
+type tupbox[T] = tup(@T);
+type recbox[T] = rec(@T x);
+
+fn tuplift[T](T t) -> tupbox[T] { ret tup(@t); }
+fn reclift[T](T t) -> recbox[T] { ret rec(x=@t); }
+
+fn main() {
+ let int foo = 17;
+ let tupbox[int] tbfoo = tuplift[int](foo);
+ let recbox[int] rbfoo = reclift[int](foo);
+ check (tbfoo._0 == foo);
+ check (rbfoo.x == foo);
+}