]> source.dussan.org Git - aspectj.git/commitdiff
280676: problem 2: allow for target not being generic
authoraclement <aclement>
Wed, 17 Jun 2009 22:27:16 +0000 (22:27 +0000)
committeraclement <aclement>
Wed, 17 Jun 2009 22:27:16 +0000 (22:27 +0000)
tests/multiIncremental/pr280676_2/base/src/p/A.java [new file with mode: 0644]
tests/multiIncremental/pr280676_2/base/src/p/Foo.aj [new file with mode: 0644]
tests/multiIncremental/pr280676_2/inc1/src/p/A.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/pr280676_2/base/src/p/A.java b/tests/multiIncremental/pr280676_2/base/src/p/A.java
new file mode 100644 (file)
index 0000000..a418f0e
--- /dev/null
@@ -0,0 +1,12 @@
+package p;
+
+import java.util.List;
+
+public class A<N extends Number, T> {
+  public static void main(String[] args) {
+       A a = new A();
+       List<String> localls = a.ls;
+       
+}
+}
+
diff --git a/tests/multiIncremental/pr280676_2/base/src/p/Foo.aj b/tests/multiIncremental/pr280676_2/base/src/p/Foo.aj
new file mode 100644 (file)
index 0000000..2356728
--- /dev/null
@@ -0,0 +1,13 @@
+package p;
+import java.util.*;
+
+aspect Foo {
+       
+       public int i;
+       
+       public List<T> A<Q,T>.ll;
+       
+       public List<String> A.ls; 
+       
+       public void A<Z,X>.m() {}
+}
diff --git a/tests/multiIncremental/pr280676_2/inc1/src/p/A.java b/tests/multiIncremental/pr280676_2/inc1/src/p/A.java
new file mode 100644 (file)
index 0000000..8eca89c
--- /dev/null
@@ -0,0 +1,12 @@
+package p;
+
+import java.util.List;
+
+public class A {
+  public static void main(String[] args) {
+       A a = new A();
+       List<String> localls = a.ls;
+       
+}
+}
+
index 9970435a20748b2775d91284c5b58b77e072e218..e4261309df1ff46259b0612887021ed99bbb54cd 100644 (file)
@@ -73,6 +73,24 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                assertNoErrors(p);
        }
 
+       public void testIncrementalGenericItds_pr280676_2() throws Exception {
+               String p = "pr280676_2";
+               initialiseProject(p);
+               build(p);
+               checkWasFullBuild();
+               assertNoErrors(p);
+               alter(p, "inc1"); // remove type variables from target type
+               build(p);
+               List errors = getErrorMessages(p);
+               // Build errors:
+               // error at \src\p\Foo.aj:8::94 The target type for the intertype declaration is not generic
+               // error at \src\p\Foo.aj:12::154 The target type for the intertype declaration is not generic
+               // error at \src\p\A.java:0::0 Inconsistent classfile encountered: The undefined type parameter N is referenced from within
+               // Foo
+               assertEquals(3, errors.size());
+               // *cough* third error, hmmm
+       }
+
        // TODO (asc) these tests don't actually verify anything!
        // public void testAtDeclareParents_280658() throws Exception {
        // AjdeInteractionTestbed.VERBOSE = true;