Bug 99578 - [1.5] Unnecessary cast is required
Summary: [1.5] Unnecessary cast is required
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 99581 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-13 05:26 EDT by shiraishi CLA
Modified: 2005-06-15 08:09 EDT (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 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