Bug 106026

Summary: [1.5][dom] ITypeBinding#isSubTypeCompatible(ITypeBinding) does not work with generic bindings
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.3 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-08-04 06:52:24 EDT
M20050727-1200

class Top<E> { }
class Sub<S> extends Top<S> { }

Take the generic type binding of the declaration Sub<S> and ask it
isSubTypeCompatible(the generic type binding of the declaration Top<E>)
is: false
expected: true

Works e.g. for
class Raw extends Top { }
Comment 1 Jerome Lanneluc CLA 2007-06-22 07:20:29 EDT
According to http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.10, "Subtyping does not extend through generic types: T <: U does not imply that C<T> <: C<U>.". So in this case, we behave as spec'ed.