Bug 106297 - [1.5][compiler] new A<X>().new B(){}
Summary: [1.5][compiler] new A<X>().new B(){}
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.1.1   Edit
Assignee: Philipe Mulet CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 03:50 EDT by Erling Ellingsen CLA Friend
Modified: 2005-09-26 11:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erling Ellingsen CLA Friend 2005-08-07 03:50:11 EDT
The Sun javac accepts this; Eclipse does not.

class A<T> { 
	class B { }
	static { 
		new A<String>().new B() {};
	}
}

The complation fails with the message "No enclosing instance of type A<T> is accessible. Must qualify 
the allocation with an enclosing instance of type A<T> (e.g. x.new A() where x is an instance of A<T>)."
Comment 1 Philipe Mulet CLA Friend 2005-08-08 08:32:39 EDT
Bug exists on 3.1.0, problem only arises in presence of anonymous type with such
qualification. 
Comment 2 Philipe Mulet CLA Friend 2005-08-08 08:32:52 EDT
Fix released in 3.1 maintenance and 3.2 stream.
Added GenericTypeTest#test793-795
Comment 3 Philipe Mulet CLA Friend 2005-08-08 08:55:39 EDT
Tests are actually GenericTypeTest#test795-797
Comment 4 Olivier Thomann CLA Friend 2005-08-09 11:41:44 EDT
Verified for 3.2M1 (I20050808-2000)
Comment 5 Olivier Thomann CLA Friend 2005-09-26 11:35:53 EDT
Verified for 3.1.1 using M20050923-1430.