incompatible return types in hierarchy fixed (IDEA-173809)

take parameter bounds into account
This commit is contained in:
Anna Kozlova
2017-06-05 19:40:36 +03:00
parent fbd082f075
commit a5501a81c0
3 changed files with 15 additions and 1 deletions

View File

@@ -195,7 +195,9 @@ public class HighlightMethodUtil {
if (returnType.equals(substitutedSuperReturnType)) return null;
if (!(returnType instanceof PsiPrimitiveType) && substitutedSuperReturnType.getDeepComponentType() instanceof PsiClassType) {
if (isJdk15 && TypeConversionUtil.isAssignable(substitutedSuperReturnType, returnType)) {
if (isJdk15 && LambdaUtil.performWithSubstitutedParameterBounds(methodSignature.getTypeParameters(),
methodSignature.getSubstitutor(),
() -> TypeConversionUtil.isAssignable(substitutedSuperReturnType, returnType))) {
return null;
}
}