Community
Participate
Working Groups
Hello! Suppose you have an enumeration that is implementing an interface: public interface InterfaceA { void a(); void b(); } public enum EnumB implements InterfaceA { B1 { public void b() { // do something for B1 } }, B2{ public void b() { // do something for B2 } }; public void a() { // do something in common } } Now suppose you are using EnumB enumeration values from within a class: public class ClassC { public ClassC() { EnumB.B1.a(); EnumB.B1.b(); } } Code completion for the first line (EnumB.B1.a()) works, while it does not for the second one (EnumB.B1.b()). Anyway, the compiler works well, because neither errors nor warnings are given for the second line. I hope to have been of help. Mauro.
Created attachment 72597 [details] Proposed fix
Released for 3.4M1. Test added: CompletionTests_1_5#test0334() -> test0335(). Proposal inference must search in superinterfaces when the receiver type is an enum.
Verified for 3.4M1 using build I20070802-0800.