| Summary: | Support callout bindings for constructors | ||
|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> |
| Component: | OTJ | Assignee: | Project Inbox <objectteams.otj-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P4 | ||
| Version: | 0.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Reducing priority as this RFE is relevant only for a very rare situation. |
This is an RFE to support callout bindings for constructors. Normally, this is not needed because creating a role together with its base can be achieved by a custom role constructor invoking a base constructor. However, by supporting callout to a base class constructor a slightly different semantics can be provided: such a callout would first create the base instance and only then create the role using the regular lifting mechanism. If a base class has a custom equals method, the newly created base may actually be equal to another base for which a role already exists, thus invoking the callout bound constructor can indeed re-use an existing role. A proposed syntax would be protected class MyRole playedBy MyBase { MyRole(T arg) -> MyBase(T arg); }