diamonds: do not capture wildcard on inference (IDEA-73689 )

This commit is contained in:
anna
2011-08-31 16:53:36 +02:00
parent 2583e0bc7b
commit ab1d2768b6
2 changed files with 22 additions and 14 deletions
@@ -295,18 +295,7 @@ public class PsiDiamondType extends PsiType {
if (myErrorMessage != null) {
return PsiType.EMPTY_ARRAY;
}
final PsiType[] result = new PsiType[myInferredTypes.size()];
for (int i = 0, myInferredTypesSize = myInferredTypes.size(); i < myInferredTypesSize; i++) {
PsiType inferredType = myInferredTypes.get(i);
if (inferredType instanceof PsiWildcardType) {
final PsiType bound = ((PsiWildcardType)inferredType).getBound();
result[i] = bound != null ? bound : PsiType.getJavaLangObject(PsiManager.getInstance(myProject), GlobalSearchScope.allScope(myProject));
}
else {
result[i] = inferredType;
}
}
return result;
return myInferredTypes.toArray(new PsiType[myInferredTypes.size()]);
}
/**