--- /dev/null
+\r
+abstract class FooBase<A> { }\r
+\r
+// Existence of this line causes the exception\r
+abstract class Foo <CC extends Resource, DD extends DataInterface<CC>> extends FooBase<DD> { }\r
+\r
+interface DataInterface<CC> {\r
+ public CC getContent(); // ERR\r
+}\r
+\r
+interface Marker<CC> extends DataInterface<CC> { }\r
+\r
+interface Resource { }\r
+\r
+aspect DataAspect {\r
+ // Intertype declaration onto Marker that shares the variable\r
+ public C Marker<C>.getContent() { // ERR\r
+ return null;\r
+ }\r
+}\r
+\r
+/*\r
+X.java:7 [error] can't override CC DataInterface<CC>.getContent() with CC Marker.getContent() return types don't match\r
+public CC getContent();\r
+ ^^^^^^^^^\r
+\r
+X.java:16 [error] can't override CC DataInterface<CC>.getContent() with CC Marker.getContent() return types don't match\r
+public C Marker<C>.getContent() {\r
+ ^^^^^^^^^\r
+\r
+1. Two errors because both source locations reported (stupid code)\r
+\r
+\r
+when failing:\r
+parent: CC DataInterface<CC>.getContent()\r
+child : CC Marker.getContent()\r
+Both return types are type variable reference types (different ones though)\r
+parent: TypeVar CC extends Resource\r
+child : CC\r
+\r
+So parent discovered the wrong type variable (the wrong CC). \r
+parent is a ResolvedMemberImpl\r
+it is considered an 'existingmember' of the type DataInterface<CC>\r
+\r
+*/\r
+\r
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.2
+ public void testGenericItdsOverrides_pr222648() { runTest("generic itds - overrides"); }
+ public void testGenericItdsOverrides_pr222648_2() { runTest("generic itds - overrides - 2"); }
public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");}
public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
public void testPublicPointcut_pr239539() { runTest("public pointcut"); }
<!-- AspectJ v1.6.2 Tests -->
<suite>
+ <ajc-test dir="bugs162/pr222648" title="generic itds - overrides">
+ <compile files="DataAspect.aj DataInterface.java Foo.java FooBase.java Marker.java Resource.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs162/pr222648" title="generic itds - overrides - 2">
+ <compile files="X.java" options="-1.5"/>
+ </ajc-test>
+
<ajc-test dir="bugs162/pr145391" title="itd calling generic method">
<compile files="GenericType.java" options="-1.5"/>
<run class="GenericType"/>