Bug 99578

Summary: [1.5] Unnecessary cast is required
Product: [Eclipse Project] JDT Reporter: shiraishi <shir>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.1   
Target Milestone: 3.1 RC3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description shiraishi CLA 2005-06-13 05:26:08 EDT
in below case, eclipse reports "Type mismatch: cannot convert from Object to 
bugElement"


public class bugSuper<T extends Object> {
	public T getData(){
		return null;
	}
}

public class bugElement {
}

public class bugClass<T extends testElement> extends testSuper<T>{
}

public class bug{
	public void method(bugClass bc){
		bugElement be = bc.getData();   << here
	}
}
Comment 1 shiraishi CLA 2005-06-13 05:28:56 EDT
I mistyped...
sorry...

[incorrect]
public class bugClass<T extends testElement> extends testSuper<T>{
}

[correct]
public class bugClass<T extends bugElement> extends bugSuper<T>{
}
Comment 2 Dani Megert CLA 2005-06-13 06:14:58 EDT
*** Bug 99581 has been marked as a duplicate of this bug. ***
Comment 3 Philipe Mulet CLA 2005-06-15 08:09:45 EDT
Actually, we behave correctly. The superclass of raw bugClass is raw bugSuper.
Thus the type of bugSuper#getData() is Object (as per formal bound of T on
bugSuper).

javac agrees with us.

Added GenericTypeTest#test754