diff options
Diffstat (limited to 'tests/bugs163/pr257754/Main.java')
-rw-r--r-- | tests/bugs163/pr257754/Main.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/bugs163/pr257754/Main.java b/tests/bugs163/pr257754/Main.java new file mode 100644 index 000000000..1da2bd117 --- /dev/null +++ b/tests/bugs163/pr257754/Main.java @@ -0,0 +1,38 @@ +package example; + +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.DeclareParents; + +public class Main { + public static void main(String[] args) { + Bar bar = new Bar(); + ((Foo)bar).doFoo(); + bar.doBar(); + } +} + +interface Foo { + public void doFoo(); +} + +class DefaultFoo implements Foo { +// Uncommenting the following fixes the error +// public DefaultFoo() { +// } + public void doFoo() { + System.out.println("In doFoo " + this.getClass()); + } +} + +class Bar { + public void doBar() { + System.out.println("Bar"); + } +} + +@Aspect +class Introduce { + @DeclareParents(value="example.Bar", defaultImpl=DefaultFoo.class) + private Foo mixin; +} + |