Community
Participate
Working Groups
The following code passes javac1.6 but ecj3.4M4 puts (a slew of warnings have been omitted): ---------- 1. ERROR in Bug4.java (at line 19) public Key<Foo, Bar> flip() { return F2B.create(); } ^^^ The type F2B is defined in an inherited type and an enclosing scope ---------- 2. ERROR in Bug4.java (at line 26) public Key<Bar, Foo> flip() { return B2F.create(); } ^^^ The type B2F is defined in an inherited type and an enclosing scope ---------- 2 problems (2 errors) ==================================================================== public class Bug4<X, Y> { public static interface Foo { } public static interface Bar { } private static class B2F extends Bug4<Bar, Foo> { } private static class F2B extends Bug4<Foo, Bar> { } public static abstract class Key<X, Y> { public abstract Key<Y, X> flip(); private static class B2F extends Key<Bar, Foo> { private static B2F create() { return new B2F(); } public Key<Foo, Bar> flip() { return F2B.create(); } } private static class F2B extends Key<Foo, Bar> { private static F2B create() { return new F2B(); } public Key<Bar, Foo> flip() { return B2F.create(); } } } }
Added InnerEmulationTest#test151. Problem located in visibility check which should ignore non visible match post 1.4 .
Created attachment 88343 [details] Proposed patch
Note that if compliance == 1.3, then the collision between inherited and enclosing still needs to be reported.
Also added InnerEmulationTest#test152
Released for 3.4M5. Fixed
Verified for 3.4M5 using build I20080204-0010
Released fix in 3.3.x maintenance branch (post 3.3.2)