-
Key: QVT13-46
-
Legacy Issue Number: 19687
-
Status: closed
-
Source: Model Driven Solutions ( Dr. Edward Willink)
-
Summary:
The two examples
mymultivaluedproperty += object Node
{ }; // additive semantics
mymultivaluedproperty := object Node { }; // the list is reset and re-assigned
are simple assignments from single valued RHS. These are not covered in the preceding description.
I consider both to be errors since the RHS is unsuitable for assignment to the LHS. In both cases an asSet() or whatever should be appended.
More generally, the library operation that exhibits the "additive semantics" should be clearly identified.
Since addition to OCL collections is not permissible, it may be necessary to define constructors, so that
var c : Set(String) := Set
{"a"};
invokes the Set(T)(Set(T)) constructor.
This would allow initialization for a Sequence from a List and vice-versa that is otherwise magic.
-
Reported: QVT 1.2 — Mon, 15 Dec 2014 05:00 GMT
-
Disposition: Duplicate or Merged — QVT 1.3
-
Disposition Summary:
Unclear multi-valued initialisation from single value
The two examples
mymultivaluedproperty += object Node
{ }; // additive semantics
mymultivaluedproperty := object Node { }; // the list is reset and re-assigned
are simple assignments from single valued RHS. These are not covered in the preceding description.
I consider both to be errors since the RHS is unsuitable for assignment to the LHS. In both cases an asSet() or whatever should be appended.
More generally, the library operation that exhibits the "additive semantics" should be clearly identified.
Since addition to OCL collections is not permissible, it may be necessary to define constructors, so that
var c : Set(String) := Set
{"a"};
invokes the Set(T)(Set(T)) constructor.
This would allow initialization for a Sequence from a List and vice-versa that is otherwise magic.
Issue Links
-
Updated: Tue, 29 Mar 2016 15:09 GMT
QVT13 — QVTo: multi-valued initialisation from single value
- Key: QVT13-46
- OMG Task Force: QVT 1.3 RTF