Bug 63555 - [1.5] Cannot put generic type fields inside static inner class
Summary: [1.5] Cannot put generic type fields inside static inner class
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 63592 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-22 17:49 EDT by Artur Biesiadowski CLA
Modified: 2005-01-11 11:02 EST (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 Artur Biesiadowski CLA 2004-05-22 17:49:26 EDT
public class Alpha {
	static class Beta<T> {
		T obj;
	}
}

This simple case gives error in cheetah 0.5:
"Cannot make a static reference to the type parameter T"
It compiles fine with javac from 1.5.0b1.
Error occurs only for static inner classes - non-static ones seem to be ok.
Comment 1 Philipe Mulet CLA 2004-05-23 16:17:18 EDT
Reproduced. Regression test added: GenericTypeTest#test205.

Problem was that insideStaticContext flag was positionned too early for 
ClassScope, when it should only be positionned after the type variable lookup 
(Scope#getTypeOrPackage(char[], int)).

Fixed.
Comment 2 Philipe Mulet CLA 2004-05-23 16:21:59 EDT
*** Bug 63592 has been marked as a duplicate of this bug. ***