Bug 78906

Summary: [1.5][compiler] this$0 is not allowed as a field in a member class
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Olivier Thomann CLA 2004-11-17 18:48:14 EST
Using latest the following code is rejected with:

----------
1. ERROR in C:\tests_sources\X.java (at line 3)
	Object this$0;
	       ^^^^^^
Duplicate field X.Y.this$0
----------
1 problem (1 error)

public class X {
	class Y {
		Object this$0;
	}
	public static void main(String[] args) {
	}
}

Since this$0 is a field generated by the compiler, this code should compile.
Comment 1 Philipe Mulet CLA 2005-02-12 09:19:08 EST
Added Compliance_1*#test098.
Fixed. Collisions are resolved by renaming this$0 into this$0$ (repeating adding
$  as long as collisions occur).

Comment 2 Jerome Lanneluc CLA 2005-02-15 07:50:44 EST
Verified in I20050214