--- /dev/null
+package pkgA;
+
+public interface Listener {
+
+ public void happened(String event);
+
+}
--- /dev/null
+package pkgA;
+
+public class Target {
+
+ public Listener listenA() {
+ return new Listener() {
+ public void happened(String event) {
+ System.out.println(event);
+ }
+ };
+ }
+
+ public static void main(String[] args) {
+ Target t = new Target();
+ t.listenA().happened("Simple A");
+ t.listenB().happened("Inferred B");
+ }
+
+}
--- /dev/null
+package pkgB;
+
+import pkgA.Listener;
+import pkgA.Target;
+
+public aspect InferListener {
+
+ public Listener Target.listenB() {
+ return new Listener() {
+ public void happened(String event) {
+ System.out.println(event);
+ }
+ };
+ }
+
+}
import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+// public void testGenericMethodBridging_pr251326() {
+// runTest("itd anonymous inner class in wrong package");
+// }
public void testAtTargetPlus_pr255856() {
runTest("attarget with plus");
</run>
</ajc-test>
+ <ajc-test dir="bugs163/pr251326" title="itd anonymous inner class in wrong package">
+ <compile files="pkgA/Listener.java pkgA/Target.java pkgB/InferListener.aj" options="-1.5"/>
+ <run class="pkgA.Target">
+ <stdout>
+ <line text="Simple A"/>
+ <line text="Inferred B"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>
\ No newline at end of file