Community
Participate
Working Groups
The service oclAsType() don't merge its NothingType. To fix this we should change the validateAllType() for instance by extending FilterService... or fix the filter index...
I think we should simply ignore all messages from oclAsType if at least one possibility is correct. For example, car.eContainer().oclAsType(Garage) will _never_ validate without errors. As long as Ecore is registered as a package in the environment, "EAnnotation.reference" is a reference that can hold any EObject, so EAnnotation will be seen as a potential eContainer for our car, and of course EAnnotation cannot be cast (oclAsType) into Garage. However, the user uses "oclAsType" exactly because he knows (or think he knows) what he's doing. We are to assume that he knows the container of his car is a garage, and the validation shouldn't return any error : there exists one possible case in which the cast won't fail.
This is correct but a bit trickier than it sounds. Indeed the validation of a service is called many time with different types (different combination can also match different services) so to cope with that I introduced the IService.validateAllType() method. But I called it in the inner validation loop ValidationServices.callType(). At first it seems to work but on some case upper loops already start to trigget many times ValidationServices.callType() leading to many call to IService.validateAllType()... It's no what we want as it could trigger this issue. What we need to do is move the IService.validateAllType() call to AstValidator.caseCall() to make sure we call is once per call. Due to other review I suggest to delay this fix after we merge: https://git.eclipse.org/r/65281 https://git.eclipse.org/r/65473 By the way my fist comment is all wrong... Laurent your comment is right but this looks like it's already done at the service level.
New Gerrit change created: https://git.eclipse.org/r/65546
*** Bug 486046 has been marked as a duplicate of this bug. ***
Gerrit change https://git.eclipse.org/r/65546 was merged to [master]. Commit: http://git.eclipse.org/c/acceleo/org.eclipse.acceleo.git/commit/?id=c372379313413bdf4eda977649d1b4ce38958590
*** Bug 483377 has been marked as a duplicate of this bug. ***