]> source.dussan.org Git - aspectj.git/commitdiff
tests for pr62475 (disabled at present)
authoracolyer <acolyer>
Wed, 11 Aug 2004 07:30:19 +0000 (07:30 +0000)
committeracolyer <acolyer>
Wed, 11 Aug 2004 07:30:19 +0000 (07:30 +0000)
tests/bugs/oxford/PR62475.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java
tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml

diff --git a/tests/bugs/oxford/PR62475.java b/tests/bugs/oxford/PR62475.java
new file mode 100644 (file)
index 0000000..3e29ffb
--- /dev/null
@@ -0,0 +1,28 @@
+/* 
+Intertype field initialisers should be resolved in the aspect
+(lexical scope), for consistency with intertype method and 
+constructor bodies.
+
+The program below compiles without warning, however, binding z
+to the z field of the target class.
+*/
+
+
+
+aspect Aspect {
+
+ public int A.x = z; // CE L14 error: z not visible.
+
+}
+
+class A {
+ int z = 0;
+}
+
+public class PR62475 {
+
+ public static void main(String[] args) {
+System.out.println(new A().x);
+ }
+
+}
\ No newline at end of file
index 968eec0bc43b582ed496340f76602baa89ee5b97..7886c9eba07c3b5ded7c180dd4d9240f0a41a567 100644 (file)
@@ -149,5 +149,9 @@ public class Ajc121Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void test027_itdsOnInnerClassesAsStatic() {
       runTest("ITDs on inner classes should be static context");
   }
+  
+//  public void test028_itdsAndInitializers() {
+//    runTest("resolution of IT field inits");
+//  }
 }
 
index 49cd75b362ccbc0d3635d3277dd225f9e3b3ce95..84df3ca976916a43ae657afecb2536d77b3bcbe2 100644 (file)
                        <message kind="error" line="15" text="Ambiguous binding of type Test"/>
                </compile>
        </ajc-test>
+<!--
+        <ajc-test dir="bugs/oxford" pr="62475"
+               title="resolution of IT field inits">
+               <compile files="PR62475.java">
+                       <message kind="error" line="14" />
+               </compile>
+       </ajc-test>
+-->    
\ No newline at end of file