Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] AJDT bug(?) in inter-type declaration

This minimal aspect:

public aspect PSTest {

    interface PS {
    }

    private PS PS._this = this;
}

...compiles and runs perfectly when compiled with ajc[1], but fails in AJDT with a compiler error: Apparently AJDT erroneously assumes the static type of the "this" expression to be PSTest rather than PSTest.PS, which leads to AJDT rejecting the assignment to a variable of type PSTest.PS.

I'm using AJDT 2.1.0 on Eclipse 3.5.2.

[1]
If you add some actual code that instantiates PS or a subclass of it and prints out the _this variable at runtime, and compile everything with ajc and run it, you see that it really does do what it should do, i.e. the correct PSTest.PS instance is assigned to _this.



Back to the top