VDM++ allows for operations to be declared as instance or class attributes -- which corresponds to "normal" and static operations.
Constructors are a special kind of operations. It is not 100% clear whether or not constructors are allowed to be static. As best as I can tell, constructors should not be static but there is no explicit ruling.
The discussion on static (sec 13.3.3) mentions certain restrictions (ex: type defs are always class attributes) but does not mention constructors.
The discussion of operation semantics ( p.94) mentions 'static' but does not clarify whether or not constructors can be static.
The discussion of constructors (sec. 11.1) does not mention 'static'. Neither does the discussion of the 'new' expression (6.13).
I would like for the LB to clarify if constructors are allowed to be static or not. And also for the language manual to be updated to mention this explicitly.
As agreed by the LB at the last NM, I have updated the LRM to say that it is not allowed to declare a constructor static. See commit 8487fdcb44b5850a6a2ffd2142e5fa5f32ae118a
VDM++ allows for operations to be declared as instance or class attributes -- which corresponds to "normal" and
static
operations.Constructors are a special kind of operations. It is not 100% clear whether or not constructors are allowed to be static. As best as I can tell, constructors should not be static but there is no explicit ruling.
The discussion on
static
(sec 13.3.3) mentions certain restrictions (ex: type defs are always class attributes) but does not mention constructors.The discussion of operation semantics ( p.94) mentions 'static' but does not clarify whether or not constructors can be static.
The discussion of constructors (sec. 11.1) does not mention 'static'. Neither does the discussion of the 'new' expression (6.13).
I would like for the LB to clarify if constructors are allowed to be static or not. And also for the language manual to be updated to mention this explicitly.
See https://github.com/overturetool/overture/issues/449 for more.