Community
Participate
Working Groups
If you try to compile the code: class C { int dummy() {return 5;} } aspect Foo { around(): call(int C.dummy()) { proceed(); } } You'll get an error, highlighting the "aspect Foo {" line that says: Syntax error on token "{", Type expected after this token Granted, the error might be obvious in this case, but if the preceeding line is a complex pointcut, one might be lead to believe there is something wrong with their pointcut instead. A better error message would highlight the line that "around" appears and say something more like Syntax error: around advice needs a return type specified I believe an error production could probably be used to handle this relatively common mistake.
didnt get to it whilst the parser was open for 1.6.0m1
Hurrah!!! I fixed this, whilst I had the grammar open to address privileged generic aspects (*shudder*). You now get a much nicer message actually indicating what the problem is! D:\Andy\eclipse_ws\aspectj_ws\tests\bugs161\pr64222\C.java:6 [error] Syntax error, insert "return type" to complete around advice declaration around(): call(int C.dummy()) { I had to add a recovery rule to the grammar that recognizes the bad pattern of tokens that are missing a return type.