diff options
Diffstat (limited to 'tests/new/PrivateIntro.java')
-rw-r--r-- | tests/new/PrivateIntro.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/new/PrivateIntro.java b/tests/new/PrivateIntro.java new file mode 100644 index 000000000..c82474b22 --- /dev/null +++ b/tests/new/PrivateIntro.java @@ -0,0 +1,40 @@ +import org.aspectj.testing.Tester; + +public class PrivateIntro { + public static void test() { + Tester.checkEqual(new A1().getWhere(), "A1", "from A1"); + Tester.checkEqual(new A2().getWhere(), "A2", "from A2"); + + } + + public static void main(String[] args) { + test(); + } +} + + +class A1 { + private introduction Foo { + String fromWhere() { + return "A1"; + } + } + + public String getWhere() { + return new Foo().fromWhere(); + } +} + +class A2 { + private introduction Foo { + String fromWhere() { + return "A2"; + } + } + + public String getWhere() { + return new Foo().fromWhere(); + } +} + +class Foo {} |