Bug 74420 - [1.5] Unexpected "Illegal forward reference to type parameter T"
Summary: [1.5] Unexpected "Illegal forward reference to type parameter T"
Status: VERIFIED 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 M2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 73414 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-09-21 09:41 EDT by Frederic Fusier CLA
Modified: 2004-09-24 05:15 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2004-09-21 09:41:01 EDT
Using build I200409210010.

For following test case:
public class Generic<T> {
	T x;
	<U extends T> T foo(U u) {
		if (u == null)
			return this.x;
		return u;
	}
}
compiler warns "U" in <U extends T>: "Illegal forward reference to type
parameter T" altough parameter T has been already defined...
Comment 1 Frederic Fusier CLA 2004-09-21 09:42:09 EDT
Note that javac 1.5.0-b64 does not complain about this syntax...
Comment 2 Kent Johnson CLA 2004-09-22 15:33:10 EDT
added test305.

Philippe: this is a 1 line change. Can it go into M2?
Comment 3 Philipe Mulet CLA 2004-09-22 15:40:26 EDT
Ok for M2
Comment 4 Kent Johnson CLA 2004-09-22 15:47:20 EDT
Released for M2.
Comment 5 Kent Johnson CLA 2004-09-23 17:32:59 EDT
*** Bug 73414 has been marked as a duplicate of this bug. ***
Comment 6 Frederic Fusier CLA 2004-09-24 05:15:17 EDT
Verified for 3.1 M2 with build I200409231635.