Bug 269388

Summary: Cannot reference a field before it is defined
Product: [Eclipse Project] JDT Reporter: Thomas Richter <tricpod>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: srikanth_sankaran
Version: 3.4.2   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Thomas Richter CLA 2009-03-19 10:48:37 EDT
Build ID: M20090211-1700

Steps To Reproduce:
public enum Enun {
	A(STATIK);
	private static int STATIK = 1;

	private Enun(final int i) {
	}
}


More information:
Comment 1 Kent Johnson CLA 2009-03-19 14:10:58 EDT

*** This bug has been marked as a duplicate of bug 263877 ***
Comment 2 Srikanth Sankaran CLA 2009-04-28 05:01:47 EDT
Since the forward reference is via a simple name, it must be complained against
per 8.3.2.3 of JLS3.0. 

I get the same error with java 1.5 and java 1.6 ("Illegal forward reference"),
so the reported behavior (cannot reference a field ...) matches javac behavior
and the spec.

See also bug 273990.

Comment 3 Srikanth Sankaran CLA 2009-04-28 05:14:02 EDT
Verified for 3.5M7 using I20090426-2000