Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Using inter-type declaration in base class

This is the well known problem that the java editor, used for .java
files has no idea where the field x is - and the eager parsing that
gives you the red squigglies highlights it as missing.  You can switch
files that use ITDs in this way to being in .aj files, that will stop
the error appearing I believe.

As you noticed, the code compiles fine.

Andy.


On 18/10/2007, Martin Goerg <nimoth@xxxxxxxxxxxxxxx> wrote:
> Hi again,
>
> I just figured out it is only Eclipse who indicates an error.
> The program actually compiles fine and the public variable is indeed
> usable in other classes.
>
> The guys working on AJDT probably know about this, right?
>
> Cheers
> Martin
>
> ----- Original Message -----
> From: "Martin Goerg" <nimoth@xxxxxxxxxxxxxxx>
> To: "Martin Görg" <nimoth@xxxxxxxxxxxxxxx>
> Sent: Thursday, October 18, 2007 3:29 PM
> Subject: Re: Using inter-type declaration in base class
>
> Hi,
>
> I have a
> class A {}
> and then introduce a new filed with
> aspect AugmentA { public int A.x == 0; } .
>
> As I understand it, because x is public, I should be able to use it in
> A. But the following code produces a compiler error.
>
> clas A { void incX() { x++ }; }
>
> What am I doing wrong or what is the concept of the public modifier
> for inter-type declarations?
>
> Thank you for help
>
> Cheers
> Martin
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top