aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr115250.aj
blob: ccda14adc061273be04683cb0ddc64c8e17f7a7a (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
29
30
31
32
33
34
35
36
public class pr115250 {
	public static void main(String[] args) {
		test();
	}
	public static void test() {
		new C();
	}

	static class C {
		C() {
			System.err.println("C.new() running");
		}		
	}

	// properly get compiler error wrt return type of join point
	static aspect Normal {
		C around() : execution(C.new()) {
			return proceed();
		}
	}
	
	
	// no compiler error wrt return type of join point
	
	static abstract aspect SS<Target> {
		abstract protected pointcut creation();
		Target around() : creation() { // expect CE for execution(C.new());
			System.err.println("Advice running");
			return proceed(); 
		}
	}
	
	static aspect A extends SS<C> {
		protected pointcut creation() : execution(C.new());
	}
}