Summary: | scope for intertype methods | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Oege de Moor <oege> |
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 1.2 | ||
Target Milestone: | 1.2.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Oege de Moor
2004-05-11 13:35:42 EDT
marked as target 1.2.1 Good bug report, thanks. I added a slightly extended version of your test program to the test suite: aspect Aspect { private static int y = 5; private class A { int x = 3; } private static class A2 {} private static void B.happy() { System.out.println(y); // happy accessing private field y } private static void B.foo(A z) { System.out.println(z.x); } private static void B.foo2(A2 z) { System.out.println(z); } public void B.bar() { B.foo(new A()); // CE L37 : no enclosing instance } public void B.bar2() { B.foo2(new A2()); } } class B { } class IT { public static void main(String[] args) { new B().bar(); } } This now compiles and correctly finds the types A and A2. Note that line 37 *is still an error* (but not the one previously reported) as a non-static inner class needs to be within an enclosing instance of the aspect, and the body of an ITDM is not such a place. Will close this bug report once the fix is available for download. Fix now available in latest jar from AspectJ download page. Fix released as part of AspectJ 1.2.1 |