Class scope versus function scope is about variable names, and does not directly relate to function calling. Consider:
class Foo {
field int x;
method int read_x() {
return x;
}
method void set_x(int value) {
let x = value;
return;
}
method int bad_read_x() {
var int x; // Initialized to 0.
return x;
}
method bad_set_x(int x) {
let x = x;
return;
}
}
read_x() and set_x() methods do what you expect.
bad_read_x() always returns 0 because the 'return x' is referring to the local variable 'x' which hides the class variable 'x'.
bad_write_x() never changes the call variable 'x' because the argument 'x' hides the class variable; the 'x=x' sets the argument to itself.
--Mark