Affects Version/s: 2.5.2, 2.5.8
Fix Version/s: None
In the following situation:
- Two class hierarchies: Child1 <|-- Child2 and Parent1 <|-- Parent0
- Classes from the second hierarchy delegate to the first ones with constructions:
- in parent:
- in child:
(in other words, all calls are delegated to the same instance, just on different levels of hierarchy)
- Methods in the first hierarchy are marked final
compiler gives an error:
Repository reproducing it: https://github.com/grv87/groovy-delegate-and-inheritance
Error presence depends on compilation order. If I rename Parent0 to Parent2, error disappears.
So, as I see, the problem is that when @Delegate is applied to Parent0, it doesn't detect that some methods are already added by another @Delegate to it's super, Parent1.
Removing final modifier just hides the problem, Parent0 still have methods overriding Parent1, which is unnecessary.