| Summary: | Polymorphisme doesn't work for EClass EReference | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Acceleo | Reporter: | Sylvain Dudoit <sylvain.dudoit> | ||||
| Component: | Core | Assignee: | Project Inbox <acceleo-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | stephane.begaudeau, yvan.lussaud | ||||
| Version: | 3.1.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
The problem come from the ecore model that has the URI of the type EClass like this: "platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EClass" and Acceleo/OCL which are using "http://www.eclipse.org/emf/2002/Ecore#//EClass". An URI Handler has been put in place to convert the platform:/plugin path to the ns URI http://www during the loading of the meta-model from the workspace. The fix will be available in Acceleo 3.2.1 and Acceleo 3.3.0 Fix contributed on HEAD and R3_2_maintenance. *** Bug 370343 has been marked as a duplicate of this bug. *** Closing resolved bugs |
Created attachment 206496 [details] Sample illustrating the bug My metamodel : - Test - domain : EClass I defined in my Acceleo templates queries for ENamedElement that should be usable for my EClass EReference. [query public getName(e : ENamedElement) : String = self.name + '-test' /] [template public generate(test : Test)] [comment @main/] Hello my domain class : [test.domain.getName()/] // Error Hello my domain class : [getName(test.domain)/] // Error Hello my domain class : [test.domain.oclAsType(ENamedElement).getName()/] // Ok Hello my domain class : [getName(test.domain.oclAsType(ENamedElement))/] // Ok [/template] The explicit cast is required to make it works. Sylvain