EVALUATION
This is a resolution bug due to the fact that javac doesn't check for superinterfaces method when resolving a method invoked on a receiver whose type is an enum type. In the submitted example we have that i() is invoked on the enum type E. Since abstract method checking is disabled, no such method is found in E. On the other hand, if we compile the enum first (or if we simply alter the order in which classes get compiled) the enum gets translated by javac into an abstract class, thus enabling abstract method checking as a side-effect. This explains why the program compiles only when a given compilation order is specified.
|