rust/src/test/run-pass/exterior.rs

19 lines
292 B
Rust
Raw Normal View History

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);
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);
}