2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
type point = rec(int x, int y, mutable int z);
|
|
|
|
|
|
|
|
fn f(@point p) {
|
|
|
|
check (p.z == 12);
|
|
|
|
p.z = 13;
|
|
|
|
check (p.z == 13);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let point a = rec(x=10, y=11, z=mutable 12);
|
2010-06-30 23:17:45 -05:00
|
|
|
let @point b = @a;
|
2010-06-23 23:03:09 -05:00
|
|
|
check (b.z == 12);
|
|
|
|
f(b);
|
|
|
|
check (a.z == 12);
|
|
|
|
check (b.z == 13);
|
|
|
|
}
|