United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6330385 Enum and interface can't compile in on step
6330385 : Enum and interface can't compile in on step

Details
Type:
Bug
Submit Date:
2005-09-29
Status:
Closed
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-03-13
Component:
tools
OS:
generic
Sub-Component:
javac
CPU:
generic
Priority:
P5
Resolution:
Cannot Reproduce
Affected Versions:
5.0
Fixed Versions:

Related Reports

Sub Tasks

Description
public class Test {
 public static void main(String[] args) {
   for (E e : E.values()) {
     e.m();
   }
 }
}

interface I {
 void m();
}

enum E implements I {
 X {
   public void m() {}
 }
}

This won't compile with one call to javac.
But if you separately compile I and E first you can then compile
Test just fine.

                                    

Comments
EVALUATION

Not reproducible after jdk 7 b39 (see 6724345)
                                     
2009-03-13
EVALUATION

Appears to be a bug in how scopes are handled for enums.
                                     
2005-09-29



Hardware and Software, Engineered to Work Together