blob: 0ec7020cdaddaf75f62da5108fc6be393c77b31d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
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);
}
|