How Is Aggregating Interfaces supposed to work?

I know it’s been around awhile but I have not tried to use interface aggregation until now.

This is for information hiding.

All Classes and interfaces are in the same module. All Classes are accessible outside the module. The interfaces are private to the module. The interface methods are meant to be accessed only by a 3rd class inside teh module.

I have Class1 to which I created interface1 for some of it’s protected methods.

I subclassed Class1 to get Class2 (which I know inherits Interface 1 but I only want to have to Cast Class2 objects once), so ) wanted an interface that includes the methods of interface1 as well as additional methods that map to protected methods in Class2.

To that end I created Interface2 that has methods that map to the new protected methods in Class2. Then set Interface2 to aggregate Interface1

When I cast to a Class2 to Interface2 only the methods defined in interface2 autocomplete.

Is this an autocomplete bug or do I need 3 interfaces where interface2 ONLY has the the new methods for class2 and an interface3 then aggregates Interface1 and Interface2

In other words can an aggregated interface ALSO have methods defined or can it ONLY aggregate other interfaces?

If It’s an Autocomplete bug/oversight it makes aggregated interfaces a lot less useful… If aggregated interfaces can not have their own methods its unnecessary bookkeeping, if it’s because interface1 methods are inherited ones for class2 then there is a logical flaw…

So basically is there a bug report here, a feature request, or am I just missing something and it should work?


  • Karen

It’s an autocomplete bug. The methods aggregated into interface2 from interface1 are callable on interface2 even though they don’t autocomplete.

An interface can have its own methods as well as aggregating one or more other interfaces.


So it work like I thought it should… but unfortunately autocomplete not working for the aggregated methods really takes away from the usefulness.

  • Karen