new inference: avoid self bounds when possible

This commit is contained in:
anna
2013-11-06 15:35:42 +01:00
parent a2ad6fd3b6
commit 646aea3a20
@@ -118,7 +118,9 @@ public class ExpressionCompatibilityConstraint extends InputOutputConstraintForm
else {
returnType = callSubstitutor.substitute(returnType);
}
constraints.add(new TypeCompatibilityConstraint(GenericsUtil.eliminateWildcards(myT, false), returnType));
if (!TypeConversionUtil.isAssignable(myT, returnType)) {
constraints.add(new TypeCompatibilityConstraint(GenericsUtil.eliminateWildcards(myT, false), returnType));
}
}
}
return true;