Bug 269388 - Cannot reference a field before it is defined
Summary: Cannot reference a field before it is defined
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.5 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-19 10:48 EDT by Thomas Richter CLA
Modified: 2009-04-28 05:14 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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