Bug 74588

Summary: [1.5] missing enclosing instance is wrongly reported when accessing an enclosing instance variable.
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Compile this test case in -source 1.5 -1.5 none

Description Olivier Thomann CLA 2004-09-22 12:03:42 EDT
In the attached test case, we report:

----------
1. ERROR in c:\tests_sources\X.java (at line 6)
	new Y<Integer>() {
                void test() {
                    System.out.println(X.this.m);
                }
            }.test();
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
No enclosing instance of type X is accessible. Must qualify the allocation with
an enclosing instance of type X (e.g. x.new A() where x is an instance of X).
----------
1 problem (1 error)

I think this should compile fine.
Comment 1 Olivier Thomann CLA 2004-09-22 12:04:13 EDT
Created attachment 14704 [details]
Compile this test case in -source 1.5 -1.5
Comment 2 Frederic Fusier CLA 2004-10-28 04:45:17 EDT
This problem is fixed in build I200410260800.
I'll add to build notes for 3.1 M3
Comment 3 Philipe Mulet CLA 2004-10-28 05:08:02 EDT
Added regression test: GenericTypeTest#test343
Comment 4 Frederic Fusier CLA 2004-11-04 10:40:21 EST
Verified for 3.1 M3 with build I200411040800