Project: AspectJ
Bug 29959 super call in intertype method declaration body causes VerifyError
Reported: 2003-01-22 07:10:28 | Status: resolved fixed

AspectJ Compiler 1.1beta4 This program: aspect Foo { void A.foo() { } void B.foo() { super.foo(); } } class A { } class B extends A { } class Main { public static void main(String[] args) { new B(); } } causes this error at runtime: Exception in thread "main" java.lang.VerifyError: (class: B, method: ajc$superDispatch$B$foo signature: ()V) Illegal use of nonvirtual function call at Main.main(Foo.java:11) Note that foo is never even called; the error happens at load time when the new B() expression causes class B to be loaded. There's no error if either one of the foo methods is declared in its class directly. This is kind of a showstopper... --Doug

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/InterTypeConstructorDeclaration.java org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/SuperFixerVisitor.java org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMethodBinding.java org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java tests/bugs/SuperToIntro.java