Community
Participate
Working Groups
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 } }
I mistyped... sorry... [incorrect] public class bugClass<T extends testElement> extends testSuper<T>{ } [correct] public class bugClass<T extends bugElement> extends bugSuper<T>{ }
*** Bug 99581 has been marked as a duplicate of this bug. ***
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