]> source.dussan.org Git - aspectj.git/commitdiff
@testcase PR83645 pertypewithin on interface
authorwisberg <wisberg>
Tue, 25 Jan 2005 21:11:56 +0000 (21:11 +0000)
committerwisberg <wisberg>
Tue, 25 Jan 2005 21:11:56 +0000 (21:11 +0000)
tests/ajcTestsFailing.xml
tests/bugs150/PR83645.java [new file with mode: 0644]

index 167f12d9e47c6f04a83da8cfaf2fde22e91d9e6b..b86bc31a3cdf0da38b3748f11facea20fdbb9259 100644 (file)
         <run class="Test_AroundVarBug"/>
     </ajc-test>
     
+    <ajc-test dir="bugs150" pr="83645"
+      title="pertypewithin on interface">
+               <compile files="PR83645.java"/>
+               <run class="PR83645"/>
+    </ajc-test>
 </suite>
diff --git a/tests/bugs150/PR83645.java b/tests/bugs150/PR83645.java
new file mode 100644 (file)
index 0000000..fa64a9c
--- /dev/null
@@ -0,0 +1,25 @@
+
+import org.aspectj.lang.NoAspectBoundException;
+
+interface IP {}
+
+/** @testcase PR83645 pertypewithin on interface */
+public class PR83645 implements IP {
+    public static void main(String[] args) {
+        try {
+            boolean yes = (PT.aspectOf(IP.class) instanceof PT);
+            throw new Error("expected NoAspectBoundException, got instance?: " + yes);
+        } catch (NoAspectBoundException e) {
+            // ok
+        }
+    }
+}
+aspect PT pertypewithin(IP+) {
+    static int INDEX;
+    final int index = INDEX++;
+    public PT() {
+    }
+    public String toString() {
+        return "me " + index;
+    }
+}
\ No newline at end of file