aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hasmember/HasPrivateMethodInherited.aj
blob: dff672b6a83977b48389504b939fc7a65884f8f2 (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 HasPrivateMethodInherited {
	
	declare parents : D && hasmethod(* print(..)) implements Printable; 

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

class C {
	
	private void print() {}
	
}

class D extends C {
	
}

interface Printable {};