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 wrote:
> The first test case also highlights what I think is a
> different compiler bug - an instanceof test that would fail at runtime
> produces an error at compilation:
>
> [  0] [error   0]: error Incompatible conditional operand types Driver.C
> and Driver.B at C:
> \ColyerRoot\Data\AspectJDev\eclipse\workspace\tests\new\declareParents\Driver.
> java:13:0
>
>
> This error seems to occur whether there are any declare parents aspect
> statements involved or not.



Doh! Of course it makes sense to raise a compilation time error if an instanceof test can be statically determined to never be passable. I just confused myself because in this test case I was hoping the instanceof test would pass...

-- Adrian.
Adrian_Colyer@xxxxxxxxxx



Adrian Colyer/UK/IBM@IBMGB
Sent by: aspectj-dev-admin@xxxxxxxxxxx

27/03/2003 17:10
Please respond to aspectj-dev

       
        To:        aspectj-dev@xxxxxxxxxxxxxxx
        cc:        
        Subject:        [aspectj-dev] Behaviour of declare parents : xxx extends yyy

       


I've been experimenting with the behaviour of declare parents - extends,
which doesn't behave quite as I anticipated - this could be my
misunderstanding or it could be a bug.

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.

I haven't raised a bug, since my interpretation could be wrong, but I've
written a couple of test cases in new/declare-parents and added them to
testsFailing.xml.  The first test case also highlights what I think is a
different compiler bug - an instanceof test that would fail at runtime
produces an error at compilation:

[  0] [error   0]: error Incompatible conditional operand types Driver.C
and Driver.B at C:
\ColyerRoot\Data\AspectJDev\eclipse\workspace\tests\new\declareParents\Driver.java:13:0


This error seems to occur whether there are any declare parents aspect
statements involved or not.

If these are accepted as valid bugs I'll raise the corresponding bugzilla
entries..., otherwise I'll back out the tests.

Cheers,
Adrian.
adrian_colyer@xxxxxxxxxx




_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-dev


Back to the top