Bug 92311

Summary: [itds] ITD private hiding base class field
Product: [Tools] AspectJ Reporter: Ron Bodkin <rbodkin+LISTS>
Component: CompilerAssignee: Adrian Colyer <adrian.colyer>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: 1.5.0M2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ron Bodkin CLA 2005-04-21 18:23:06 EDT
Sample source:
public class Base {
    int x;
}

aspect ExtendBase {
    private int x;
    declare parents: Y extends ExtendBase;
}

class Y extends Base {
    public int foo() {
	System.out.println(x);
    }
}

I believe this is valid AspectJ code. Compiling with 1.5.0M2 gives the 
following errors:
C:\devel\test\itd\hiding>ajc Base.java
C:\devel\test\itd\hiding\Base.java:10 [error] Implicit super constructor 
ExtendB
ase() is not visible for default constructor. Must define an explicit 
constructo
r
class Y extends Base {

C:\devel\test\itd\hiding\Base.java:12 [error] The field x is not visible
System.out.println(x);


2 errors
Comment 1 Adrian Colyer CLA 2005-08-26 11:22:06 EDT
look at for M4
Comment 2 Andrew Clement CLA 2005-10-05 08:27:10 EDT
test program in cvs.
Comment 3 Adrian Colyer CLA 2005-10-28 06:29:50 EDT
The program as it stands is not valid (ExtendBase does *not* extend Base), so we should put out a 
better error message. If ExtendBase does extend Base, the error is still the same as the aspect has a 
non-public default constructor. 

A hierarchy with

Class
  |
Aspect
  |
Class

is certainly unusual enough that we won't hold 1.5.0 for it!