### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java,v retrieving revision 1.66 diff -u -r1.66 TypeBinding.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 10 Jan 2006 14:37:28 -0000 1.66 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeBinding.java 17 Feb 2006 11:12:23 -0000 @@ -397,14 +397,28 @@ } WildcardBinding otherWildcard = (WildcardBinding) otherType; if (otherWildcard.otherBounds != null) return false; // not a true wildcard (intersection type) + TypeBinding otherBound = otherWildcard.bound; switch(otherWildcard.boundKind) { case Wildcard.EXTENDS: - if (otherWildcard.bound == this) return true; // ? extends T <= ? extends ? extends T - return upperBound != null && upperBound.isCompatibleWith(otherWildcard.bound); + if (otherBound == this) return true; // ? extends T <= ? extends ? extends T + if (upperBound instanceof ReferenceBinding) { + ReferenceBinding match = ((ReferenceBinding)upperBound).findSuperTypeWithSameErasure(otherBound); + if (match != null && match.isRawType()) { + return match == otherBound; // forbide: Collection <= ? extends Collection + } + } + return upperBound != null && upperBound.isCompatibleWith(otherBound); case Wildcard.SUPER : - if (otherWildcard.bound == this) return true; // ? super T <= ? super ? super T - return lowerBound != null && otherWildcard.bound.isCompatibleWith(lowerBound); + if (otherBound == this) return true; // ? super T <= ? super ? super T + if (lowerBound == null) return false; + if (otherBound instanceof ReferenceBinding) { + ReferenceBinding match = ((ReferenceBinding)otherBound).findSuperTypeWithSameErasure(lowerBound); + if (match != null && match.isRawType()) { + return match == lowerBound; // forbide: Collection <= ? super Collection + } + } + return otherBound.isCompatibleWith(lowerBound); case Wildcard.UNBOUND : default: