Issue 18319: OclAny::oclAsType postcondition implies type change (ocl2-rtf) Source: Model Driven Solutions (Dr. Edward Willink, ed(at)willink.me.uk) Nature: Clarification Severity: Minor Summary: post: (result = self) and result.oclIsTypeOf( t ) requires oclAsType to change the type of self. The constraint should be: post: (result = self) and result.oclIsKindOf(t) [Review all usage of oclIsType() since it's nearly always wrong to use oclIsType rather than oclIsKindOf.] Resolution: Should indeed be oclIsKindOf and the argument should be 'type' as in the signature. Reviewing other oclIsTypeOf uses identifies just one clear error in 8.2.1 since CollectionType has derived SetType and other types. Other usages seem to be either ok but inelegant since the type is a leaf type, or deliberate constraints for an invariant Revised Text: In 8.2.1 CollectionType [9] [1] replace c.oclIsTypeOf(CollectionType) by c.oclIsKindOf(CollectionType) In 11.3.1 OclAny::oclAsType replace post: (result = self) and result.oclIsTypeOf( t ) by post: (result = self) and result.oclIsKindOf( type ) Actions taken: December 14, 2012: received issue December 23, 2013: closed issue Discussion: End of Annotations:===== m: webmaster@omg.org Date: 14 Dec 2012 09:40:44 -0500 To: Subject: Issue/Bug Report X-Brightmail-Tracker: AAAAARy2NIA= X-Brightmail-Tracker: AAAAAA== ******************************************************************************* Name: Edward Willink Employer: mailFrom: ed@willink.me.uk Terms_Agreement: I agree Specification: OCL Section: 11 FormalNumber: 12-01-01 Version: 2.3.1 Doc_Year: 2012 Doc_Month: January Doc_Day: 01 Page: 147 Title: OclAny::oclAsType postcondition implies type change Nature: Clarification Severity: Minor CODE: 3TMw8 B1: Report Issue Description: post: (result = self) and result.oclIsTypeOf( t ) requires oclAsType to change the type of self. The constraint should be: post: (result = self) and result.oclIsKindOf(t) [Review all usage of oclIsType() since it's nearly always wrong to use oclIsType rather than oclIsKindOf.]