Bug 29959 - super call in intertype method declaration body causes VerifyError
Summary: super call in intertype method declaration body causes VerifyError
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-22 07:10 EST by Doug Orleans CLA
Modified: 2003-02-13 16:00 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Orleans CLA 2003-01-22 07:10:28 EST
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
Comment 1 Jim Hugunin CLA 2003-02-13 16:00:54 EST
fixed in current cvs tree with test in bugs/SuperToIntro.java