What steps will reproduce the problem?
var x = 0;
method foo() {
x = 5;
java.lang.System.out.println(x);
}
state S {
method bar() {
x = 10;
java.lang.System.out.println(x);
}
}
method main() {
foo();
(new S).bar();
}
Or see attachment.
What is the expected output? What do you see instead?
The expected behavior would be that both writes refer to the global
variable 'x' and the output is:
5
10
Instead what you see is this:
5
"Object does not have member x. Assignment failed."
So the write access in the method "bar" does not work. In general one
would expect write accesses to always refer to the most local variable
which is in scope, i.e. local -> field -> global.
Currently, we are using a strange mix of static and dynamic lookup for
assignments which leads to this problem. We check statically if a "this"
object is available and delay the check if the object really has the
needed member until runtime.
Original issue reported on code.google.com by manuelmohr@gmail.com on 2 Jun 2010 at 12:28
Original issue reported on code.google.com by
manuelmohr@gmail.com
on 2 Jun 2010 at 12:28Attachments: