Closed eclipse-ocl-bot closed 1 month ago
By Alexander Igdalov on Oct 06, 2009 03:39
Ed, could you clarify it?
We have 3 options:
We cannot define an operation oclIsUndefined() for the context EEnumLiteral
We can define it but cannot invoke in case when the actual and declared types are the same, i.e.:
let el : EEnumLiteral = ... in el.oclIsUndefined()
let el : OclAny = MyEnum::SOME_VALUE in el.oclIsUndefined()
calls OclAny::oclIsUndefined() but not EEnumLiteral::oclIsUndefined().
If (1) or (2) - then it is definitely a bug. If (3) then the behaviour might be correct. I am inclined to think there is no dynamic (late) binding in OCL. It is introduced in QVTO only in imperative operation calls. See my comment at https://bugs.eclipse.org/bugs/show_bug.cgi?id=290680#c12 .
By Ed Willink on Oct 06, 2009 15:35
See the mdt-ocl-dev Re: Refactoring the OCL evaluation visitor\ for a discussion on dynamic binding.
By Ed Willink on Mar 14, 2011 16:10
The pivot model evaluator uses vdynamic dispatch.
By Ed Willink on May 27, 2011 06:41
Resolved for Indigo is 3.1.0 not 3.2.0.
By Ed Willink on May 29, 2012 13:24
Closing all bugs resolved in Indigo.
| --- | --- | | Bugzilla Link | 291220 | | Status | CLOSED FIXED | | Importance | P3 normal | | Reported | Oct 02, 2009 12:05 EDT | | Modified | May 29, 2012 13:24 EDT | | Version | 1.3.0 | | Blocks | 318248 | | Reporter | Ed Willink |
Description
news://news.eclipse.org:119/ha55b0$6sd$1@build.eclipse.org
requests the ability to override oclIsUndefined so that a user EEnum value can be invalid.
This seems eminently reasonable and I would expect that
context EEnumLiteral::oclIsUndefined() : Boolean = self == MyEnum::INVALID
should work.
NB this requires dynamic overridding of all operations.