rust/src/test/run-pass/obj-self-2.rs
Marijn Haverbeke 1a68a98824 Disallow writing to function arguments again
Remove implicit copying hack.

Closes #1118
2011-11-03 10:57:54 +01:00

13 lines
208 B
Rust

fn main() {
obj foo() {
fn m1(i: int) { let i = i + 1; log "hi!"; }
fn m2(i: int) { let i = i + 1; self.m1(i); }
}
let a = foo();
let i: int = 0;
a.m1(i);
a.m2(i);
}