Project: AspectJ
Bug 100260 [generics][itds] methods inherited from a generic parent
Reported: 2005-06-15 14:29:21 | Status: resolved fixed

when using an intertype declaration to add a method to a generic class, the method is not correctly inherited. the bug doesn't apply to fields. Strangely enough, raw types (generic types instantiated without specifying a type parameter) inherit the methods properly: class Generic_Parent<T> {} class Child extends Generic_Parent<Integer> {} class Generic_Child<T> extends Generic_Parent<Integer> {} aspect Injector { public void Generic_Parent.inherited_method() {} public int Generic_Parent.inherited_field; public void test() { int inherited_field; inherited_field = new Generic_Child().inherited_field; // works inherited_field = new Generic_Child<Integer>().inherited_field; // works inherited_field = new Child().inherited_field; // works new Generic_Child().inherited_method(); // works new Generic_Child<Integer>().inherited_method(); // unresolved new Child().inherited_method(); // unresolved } }

Files changed in fix:
tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java