From 9d36a87c1f64a2c214cab2be16b2eda8b79cdf87 Mon Sep 17 00:00:00 2001 From: acolyer Date: Wed, 11 Aug 2004 07:30:19 +0000 Subject: [PATCH] tests for pr62475 (disabled at present) --- tests/bugs/oxford/PR62475.java | 28 +++++++++++++++++++ .../systemtest/ajc121/Ajc121Tests.java | 4 +++ .../systemtest/ajc121/ajc121-tests.xml | 8 ++++++ 3 files changed, 40 insertions(+) create mode 100644 tests/bugs/oxford/PR62475.java diff --git a/tests/bugs/oxford/PR62475.java b/tests/bugs/oxford/PR62475.java new file mode 100644 index 000000000..3e29ffb0a --- /dev/null +++ b/tests/bugs/oxford/PR62475.java @@ -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 diff --git a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java index 968eec0bc..7886c9eba 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc121/Ajc121Tests.java @@ -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"); +// } } diff --git a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml index 49cd75b36..84df3ca97 100644 --- a/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc121/ajc121-tests.xml @@ -223,3 +223,11 @@ + \ No newline at end of file -- 2.39.5