Bug 78906 - [1.5][compiler] this$0 is not allowed as a field in a member class
Summary: [1.5][compiler] this$0 is not allowed as a field in a member class
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-17 18:48 EST by Olivier Thomann CLA
Modified: 2005-02-15 07:50 EST (History)
0 users

See Also:


Attachments

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