Bug 92311 - [itds] ITD private hiding base class field
Summary: [itds] ITD private hiding base class field
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-21 18:23 EDT by Ron Bodkin CLA
Modified: 2007-10-23 08:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!