Project: AspectJ
Bug 42993 Language regression, or possible language improvement?
Reported: 2003-09-12 04:26:44 | Status: resolved fixed

The file AspectBug.java: public aspect AspectBug extends AbstractCaching perthis(execution(ContainerLoader+.new(..))) { declare parents: ContainerDescriptor implements AbstractCaching.Key; protected pointcut loadExecutions( Key key ): ContainerLoader.containerLoads( *, key ); } abstract aspect AbstractCaching { interface Key {} protected abstract pointcut loadExecutions(Key key); } class Key { } class ContainerDescriptor { } class ActiveContainer { } class ContainerLoader { public ActiveContainer createContainer(ContainerDescriptor c) { return null; } public pointcut containerLoads(ContainerLoader loader, ContainerDescriptor containerDesc ): this(loader) && args(containerDesc) && execution(ActiveContainer ContainerLoader.createContainer (ContainerDescriptor)); } First, here are the versions of AspectJ I'm using (this is a bash shell under cygwin on Windows XP): ~> CLASSPATH='C:\aspectj1.0\lib\aspectjrt.jar' /cygdrive/c/aspectj1.0/bin/ajc - version ajc version 1.0.6 (built Jul 24, 2002 6:21 PM PST) running on java 1.4.1_02 ~> CLASSPATH='C:\aspectj1.1\lib\aspectjrt.jar' /cygdrive/c/aspectj1.1/bin/ajc - version AspectJ Compiler 1.1.0 ~> CLASSPATH='C:\aspectj1.1.1rc1 \lib\aspectjrt.jar' /cygdrive/c/aspectj1.1.1rc1/bin/ajc -version AspectJ Compiler 1.1.1rc1 ~> CLASSPATH='C:\aspectj1.1.1 \lib\aspectjrt.jar' /cygdrive/c/aspectj1.1.1/bin/ajc -version AspectJ Compiler 1.1.1 For all four of these compilers, I give them the AspectBug.java file (which is attached): ~> CLASSPATH='C:\aspectj1.0\lib\aspectjrt.jar' /cygdrive/c/aspectj1.0/bin/ajc AspectBug.java ~> CLASSPATH='C:\aspectj1.1\lib\aspectjrt.jar' /cygdrive/c/aspectj1.1/bin/ajc AspectBug.java ~> CLASSPATH='C:\aspectj1.1.1rc1 \lib\aspectjrt.jar' /cygdrive/c/aspectj1.1.1rc1/bin/ajc AspectBug.java ~> CLASSPATH='C:\aspectj1.1.1 \lib\aspectjrt.jar' /cygdrive/c/aspectj1.1.1/bin/ajc AspectBug.java C:\Documents and Settings\Macneil Shonle\AspectBug.java:7 incompatible type, expected ContainerDescriptor found BindingTypePattern(AbstractCaching$Key, 0) 1 error As you can see, only the final run (with the Sept 11 build of ajc) do we see the "incompatible type" error. If this is not a regression but a desirable result, how should the code be ported?

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java tests/bugs/ParentsAndPointcuts.java weaver/src/org/aspectj/weaver/CrosscuttingMembersSet.java weaver/src/org/aspectj/weaver/ResolvedTypeX.java