Bug 72226

Summary: [1.5] Eclipse rejects valid code
Product: [Eclipse Project] JDT Reporter: gregory guthrie <guthrie>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description gregory guthrie CLA 2004-08-18 21:46:28 EDT
Compile error in Eclipse, compiles fine from Javac (1.5).

Error::
Severity	Description	Resource	In Folder	Location	Creation Time
2	Bound mismatch: The type Foo is not a valid substitute for the bounded
parameter <T extends Composite<T>> of the type Composite<T>	Composite.java
Tiger/Samples	line 18	August 18, 2004 3:42:20 PM


Code::

/*
 * Created on Aug 18, 2004
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package Samples;

import java.util.*;

class Composite<T extends Composite<T>> implements java.lang.Iterable<T> {
	public Iterator<T> iterator() {
	return null; // todo implement
	}
}

// Eclipse error here..
class Foo extends Composite<Foo> {
	Iterator<Foo> i = iterator();
}
Comment 1 Olivier Thomann CLA 2004-08-19 14:24:25 EDT
Update title according to bug description
Comment 2 Kent Johnson CLA 2004-08-26 14:54:17 EDT
Not sure which build you were using but this is fixed with the latest changes 
in HEAD.