Community
Participate
Working Groups
I20050202-0800 The compiler must not allow an implicit static reference to an outer type. class Outer<O> { class Inner { } static void test(Inner i) { } //javac: ^ non-static class p.Outer.Inner cannot be // referenced from a static context }
This compiles fine: class Outer { class Inner { } static void test(Inner i) { } } but once the reference involves a generic type it does not.
This also compiles fine: class Outer { class Inner<T> { } static void test(Inner i) { } } as does: class X<T> { static class Outer { class Inner { } static void test(Inner i) { } } }
Added GenericTypeTest#test620-623. Added static check during name resolution for member types. Fixed (will be released along with changes for bug 84496)
Released
Verified in I20050510-0010. Opened bug 94747 to fix the unoptimal error message.