Bug 72226 - [1.5] Eclipse rejects valid code
Summary: [1.5] Eclipse rejects valid code
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-18 21:46 EDT by gregory guthrie CLA
Modified: 2004-08-26 14:54 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 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.