| Summary: | StackOverflow when trying to call a "super" template | ||
|---|---|---|---|
| Product: | [Modeling] Acceleo | Reporter: | Pierre-Charles David <pierre-charles.david> |
| Component: | Core | Assignee: | Project Inbox <acceleo-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | laurent.goubet |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
|
Description
Pierre-Charles David
Acceleo will always call the most specific template. [b.A::genText()/] will result in the same as [b.oclAsType(A).genText()/]. The compiled template invocation indeed points to calling the "genText(A)" version, but at runtime we always check whether there's a more specific template we can call; so these two are exactly the same as calling directly [b.genText()/] in the present case. The specification says nothing about which template to call in case of multiple templates sharing the same name but having distinct parameters. A workaround in this case would be to create a third template and calling it from both : [template public genText(a : A)] [a.commonText()/] [/template] [template public genText(b : B)] [b.commonText()/] text for B [/template] [template public commonText(a : A)] text for A [/template] Marking as won't fix as this behavior is not planned to be changed. |