overture
overture copied to clipboard
Object arguments are not seen as state
There is a problem with object references passed as arguments to operations, because parameters are always treated as non-state values, whereas object do contain state. So for example, the following spec produces an error, saying that obj cannot be accessed as state from this context.
class A
instance variables
public iv:nat := 0;
operations
public test: A ==> ()
test(obj) == obj.iv := 0;
end A
The solution is just to treat class parameter types as NameScope STATE rather than LOCAL.
This has been fixed in VDMJ, but Overture is still wrong. I'll take a look (not before 2.5.2 though)