Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354392

Summary: Xtend: Support for inheritance of (non-static) extensions
Product: [Modeling] TMF Reporter: Stefan Ocke <stefan.ocke>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: sven.efftinge
Version: 2.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Stefan Ocke CLA 2011-08-10 11:18:41 EDT
Build Identifier: 

It would be nice to have a way to inherit a (non-static) extension.

That is, if I declare some field with the "extension" keyword, I would like to use the introduced extension methods in all subclasses.
Currently, one has to define the extension again and again in the subclasses.

A possible solution could be to allow to add "extension" keyword to "getter"-Methods, that is, to methods with no parameters, that return some object.
since the method is visible to all subclasses, they could access the extension.

(otherwise, one would need to support protected fields, which seems not to be wanted...)

Reproducible: Always
Comment 1 Sven Efftinge CLA 2011-08-15 04:49:11 EDT
This should be solved by introducing visibility.

*** This bug has been marked as a duplicate of bug 341955 ***