Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Behaviour of declare parents : xxx extends yyy

Adrian Colyer wrote:
> Given class C extends B extends A,
> and class E extends D
> 
> I would expect
> declare parents : C extends A;
> 
> to leave C unchanged (i.e. it should still inherit from B, the semantics
> of
> declare parents being that afterwards instances of C should pass the
> instanceof A test). Currently the compiler just leaves C extending A (the
> declare does exactly what it says on the tin), which loses all the
> function
> that would have been inheritied from B - i.e. it is a destructive
> inter-type declaration.
> 
> Likewise, I would expect
> declare parents : E extends A;
> 
> to result in a compilation error since the condition cannot be
> non-destructively satisfied.

These two expectations are correct and you should raise them as bugs.  Feel free to include a patch as well ;-)

You've already noticed the error in the instanceof test that's guaranteed to fail, so make sure that the test cases you commit have that fixed.

-Jim


Back to the top