summaryrefslogtreecommitdiffstats
path: root/tests/hasmember/HasPrivateFieldInherited.aj
blob: b4d7b9abc5d5c7d6dcc4a2500279ae91dcce8ba4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public aspect HasPrivateFieldInherited {
	
	declare parents : D && hasfield(* printer) implements Printable; 

	public static void main(String[] args) {
		C c = new C();
		if ((c instanceof Printable)) {
			throw new RuntimeException("declare parents : hasfield failed on super");
		}
		D d = new D();
		if ((d instanceof Printable)) {
			throw new RuntimeException("declare parents : hasfield failed on sub");
		}
		
	}
}

class C {
	
	private String printer;
	
}

class D extends C {
	
}

interface Printable {};