Issue 19687: Unclear multi-valued initialisation from single value (qvt-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Clarification Severity: Minor 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. Resolution: 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 Revised Text: Actions taken: December 15, 2014: received issue December 22, 2015: Duplicate or Merged March 29, 2016: closed issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 15 Dec 2014 12:08:43 -0500 To: Subject: Issue/Bug Report ******************************************************************************* Name: E.D Willink Employer: mailFrom: ed@willink.me.uk Terms_Agreement: I agree Specification: QVT 1.2 Section: 8.2.1.11 FormalNumber: - Version: 1.2 Beta Doc_Year: Year Doc_Month: Month Doc_Day: Day Page: 115 Title: Unclear multi-valued initialisation from single value Nature: Clarification Severity: Minor CODE: 3TMw8 B1: Report Issue Remote Name: edwillink.plus.com Remote User: HTTP User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0 Time: 12:08 PM Description: 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.