aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs169/pr298388/PR298388.java
blob: dae3c10138e2d77cb8a98bee95ba264ca74f3139 (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
37
38
39
40
41
42
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.DeclareMixin;

@Aspect
public class PR298388 {

	@DeclareMixin("Thing2")
	public static <T> Thing<T> createThingImplementation() {
		return new ThingImpl<T>();
	}
	
	public static void main(String[] args) {
		Thing<String> ts = (Thing<String>) new Thing2<String>();
		ts.wibble();
		ts.wibble("abc");
		String s = ts.wibbleBack("wobble");
		System.out.println("done");
	}
	
}

class Thing2<X> {
}

interface Thing<X> {
	void wibble();
	void wibble(X x);
	X wibbleBack(X x);
}

class ThingImpl<X> implements Thing<X> {
	ThingImpl() {
	}

	public void wibble() {
	}
	
	public void wibble(X x) {}
	
	public X wibbleBack(X x) { return x;}

}