summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2008-08-20 22:06:53 +0000
committeraclement <aclement>2008-08-20 22:06:53 +0000
commitd94ade722d8a1212aa7c9b6ca90fe47a637e2c7a (patch)
tree7d19bc74861efdfd5044e621666ab12f3f1b7ccc /tests
parent95bf99ab559ce926df99e84f811934f98eaf6b49 (diff)
downloadaspectj-d94ade722d8a1212aa7c9b6ca90fe47a637e2c7a.tar.gz
aspectj-d94ade722d8a1212aa7c9b6ca90fe47a637e2c7a.zip
222648: testcode
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs162/pr222648/DataAspect.aj11
-rw-r--r--tests/bugs162/pr222648/DataInterface.java9
-rw-r--r--tests/bugs162/pr222648/Foo.java12
-rw-r--r--tests/bugs162/pr222648/FooBase.java9
-rw-r--r--tests/bugs162/pr222648/Marker.java7
-rw-r--r--tests/bugs162/pr222648/Resource.java5
-rw-r--r--tests/bugs162/pr222648/X.java46
-rw-r--r--tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc162/ajc162.xml8
9 files changed, 109 insertions, 0 deletions
diff --git a/tests/bugs162/pr222648/DataAspect.aj b/tests/bugs162/pr222648/DataAspect.aj
new file mode 100644
index 000000000..e1e10803e
--- /dev/null
+++ b/tests/bugs162/pr222648/DataAspect.aj
@@ -0,0 +1,11 @@
+package test;
+
+public aspect DataAspect
+{
+
+ public CONTENT Marker<CONTENT>.getContent()
+ {
+ return null;
+ }
+
+}
diff --git a/tests/bugs162/pr222648/DataInterface.java b/tests/bugs162/pr222648/DataInterface.java
new file mode 100644
index 000000000..76e9b18f8
--- /dev/null
+++ b/tests/bugs162/pr222648/DataInterface.java
@@ -0,0 +1,9 @@
+package test;
+
+public interface DataInterface<CONTENT>
+{
+
+ public CONTENT getContent();
+
+
+}
diff --git a/tests/bugs162/pr222648/Foo.java b/tests/bugs162/pr222648/Foo.java
new file mode 100644
index 000000000..ebf2b0b8b
--- /dev/null
+++ b/tests/bugs162/pr222648/Foo.java
@@ -0,0 +1,12 @@
+package test;
+
+
+
+abstract public class Foo
+< CONTENT extends Resource<CONTENT>,
+ DATA extends DataInterface<CONTENT>
+>
+ extends
+ test.FooBase<DATA>
+{
+}
diff --git a/tests/bugs162/pr222648/FooBase.java b/tests/bugs162/pr222648/FooBase.java
new file mode 100644
index 000000000..e9e0e25b6
--- /dev/null
+++ b/tests/bugs162/pr222648/FooBase.java
@@ -0,0 +1,9 @@
+package test;
+
+
+
+abstract public class FooBase<A>
+{
+}
+
+
diff --git a/tests/bugs162/pr222648/Marker.java b/tests/bugs162/pr222648/Marker.java
new file mode 100644
index 000000000..46718e03e
--- /dev/null
+++ b/tests/bugs162/pr222648/Marker.java
@@ -0,0 +1,7 @@
+package test;
+
+
+
+public interface Marker<CONTENT> extends DataInterface<CONTENT>
+{
+}
diff --git a/tests/bugs162/pr222648/Resource.java b/tests/bugs162/pr222648/Resource.java
new file mode 100644
index 000000000..1a7f938be
--- /dev/null
+++ b/tests/bugs162/pr222648/Resource.java
@@ -0,0 +1,5 @@
+package test;
+
+public interface Resource<RESOURCE>
+{
+}
diff --git a/tests/bugs162/pr222648/X.java b/tests/bugs162/pr222648/X.java
new file mode 100644
index 000000000..451dd70a0
--- /dev/null
+++ b/tests/bugs162/pr222648/X.java
@@ -0,0 +1,46 @@
+
+abstract class FooBase<A> { }
+
+// Existence of this line causes the exception
+abstract class Foo <CC extends Resource, DD extends DataInterface<CC>> extends FooBase<DD> { }
+
+interface DataInterface<CC> {
+ public CC getContent(); // ERR
+}
+
+interface Marker<CC> extends DataInterface<CC> { }
+
+interface Resource { }
+
+aspect DataAspect {
+ // Intertype declaration onto Marker that shares the variable
+ public C Marker<C>.getContent() { // ERR
+ return null;
+ }
+}
+
+/*
+X.java:7 [error] can't override CC DataInterface<CC>.getContent() with CC Marker.getContent() return types don't match
+public CC getContent();
+ ^^^^^^^^^
+
+X.java:16 [error] can't override CC DataInterface<CC>.getContent() with CC Marker.getContent() return types don't match
+public C Marker<C>.getContent() {
+ ^^^^^^^^^
+
+1. Two errors because both source locations reported (stupid code)
+
+
+when failing:
+parent: CC DataInterface<CC>.getContent()
+child : CC Marker.getContent()
+Both return types are type variable reference types (different ones though)
+parent: TypeVar CC extends Resource
+child : CC
+
+So parent discovered the wrong type variable (the wrong CC).
+parent is a ResolvedMemberImpl
+it is considered an 'existingmember' of the type DataInterface<CC>
+
+*/
+
diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
index 3f970fb2f..c4578effe 100644
--- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
@@ -19,6 +19,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
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"); }
diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
index 7699dcc38..17f3ec741 100644
--- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
+++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml
@@ -3,6 +3,14 @@
<!-- 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"/>