Issue 13225: Redundant CollectionLiteralExp::kind complicates collection type extension (ocl2-rtf) Source: Borland Software Corporation (Mr. Radek Dvorak, radek.dvorak(at)borland.com) Nature: Uncategorized Issue Severity: Summary: The CollectionLiteralExp class defines the 'kind' attribute to indicate the specific collection type of the literal (8.3.5 Literal Expressions). This information is redundant as the collection kind can be deduced from the 'type' association inherited from the TypedElement. As the attribute type is CollectionKind enumeration, it restricts to the set of predefined OCL collection types. Other languages that extend OCL, like QVT does, may need to define custom CollectionType subclasses but can't reuse CollectionLiteralExp as it's impossible to provide a suitable collection kind value. Proposed resolution: Remove the CollectionLiteralExp::kind attribute, eventually consider removing the CollectionKind enumeration. Resolution: Revised Text: Actions taken: January 8, 2009: rewceived issue Discussion: The information CollectionLiteralExp::kind is effectively redundant since in theory it can be computed by inspecting the type information. I guess the 'kind' attribute was introduced to facilitate "very lazy" type instantiation (like not building the type associated with the tuple literal). One possible option, instead of removing the attribute, could be to state it is optional. I suggest deferring the resolution of this issue to give more time to people to discuss on the resolution proposal. Disposition: Deferred End of Annotations:===== ubject: [ocl2-rtf] Redundant CollectionLiteralExp::kind complicates collection type extension Date: Thu, 8 Jan 2009 04:51:43 -0800 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ocl2-rtf] Redundant CollectionLiteralExp::kind complicates collection type extension Thread-Index: Aclxj9s3S3pKWJirTFyDSTw1oYRQpA== From: "Radek Dvorak" To: X-OriginalArrivalTime: 08 Jan 2009 12:50:51.0161 (UTC) FILETIME=[BC629890:01C9718F] The CollectionLiteralExp class defines the 'kind' attribute to indicate the specific collection type of the literal (8.3.5 Literal Expressions). This information is redundant as the collection kind can be deduced from the 'type' association inherited from the TypedElement. As the attribute type is CollectionKind enumeration, it restricts to the set of predefined OCL collection types. Other languages that extend OCL, like QVT does, may need to define custom CollectionType subclasses but can't reuse CollectionLiteralExp as it's impossible to provide a suitable collection kind value. Proposed resolution: Remove the CollectionLiteralExp::kind attribute, eventually consider removing the CollectionKind enumeration.