Community
Participate
Working Groups
Created attachment 110672 [details] Junit testcase Assume, an additional operation is defined on Real. I would expect a successful parse of an expression, which tries to access it on Integer, which is a subclass of Real. Similarly, an operation on OclAny would raise the same issue. Seems the reason is org.eclipse.ocl.AbstractEnvironment.getAdditionalOperations(C), which collects the additionals within the classifier type hierarchy and uses UMLReflection.getAllSupertypes(C) only. That operation skips predefined types, I think by design (not in javadoc but other similar operations mention that (as those are known by the parser). See the attached unit-test.
Sorry, accidentally touched pmc_approved flag. Trying to revert...
Thanks for the testcase, Radek. I added three more: one for inheritance of additional OclAny operations and two for inheritance of additional attributes from Real and from OclAny. Note, of course, that collections would not inherit operations from OclAny, and there is no concrete syntax for accessing attributes of collections.
Fix available in HEAD: 1.3.0.I200808302022.
Closing after over a year in verified state.