OCL 2.1 RTF Avatar
  1. OMG Issue

OCL21 — section 7.4.6 (p. 12)

  • Key: OCL21-306
  • Legacy Issue Number: 12448
  • Status: closed  
  • Source: Anonymous
  • Summary:

    In section 7.4.6 (p. 12) it is said "An object can only be re-typed to one of its subtypes; ... If the actual type of the object is not a subtype of the type to which it is re-typed, the expression is undefined" While in section 7.5.8 (p. 19) it is said Whenever we have a class B as a subtype of class A, and a property p1 of both A and B, we can write: context B inv: self.oclAsType(A).p1 – accesses the p1 property defined in A self.p1 – accesses the p1 property defined in B and thus an example is shown where an object is retyped to its supertype. Both sections 7.4.6 and 7.5.8 should be joined into one. See slide 32 in my handouts to see a possible abstract of the joined section.

  • Reported: OCL 2.0 — Wed, 14 May 2008 04:00 GMT
  • Disposition: Resolved — OCL 2.1
  • Disposition Summary:

    The problem is fixed by resolution of issue 7341. Casting and accessing properties from a supertype are two different things.

    Disposition: See Issue 7341 for disposition

  • Updated: Fri, 6 Mar 2015 20:58 GMT