unchecked cast warning: missed captured wildcards (IDEA-158080); reifiable captured wildcard type

This commit is contained in:
Anna Kozlova
2016-07-01 12:44:39 +03:00
parent 7896eddc3b
commit a714c0d820
4 changed files with 32 additions and 0 deletions
@@ -74,6 +74,10 @@ public class JavaGenericsUtil {
return true;
}
if (type instanceof PsiCapturedWildcardType) {
return isReifiableType(((PsiCapturedWildcardType)type).getUpperBound());
}
return false;
}
@@ -127,6 +131,9 @@ public class JavaGenericsUtil {
if (castType instanceof PsiClassType) {
final PsiClassType castClassType = (PsiClassType)castType;
operandType = operandType.getDeepComponentType();
if (operandType instanceof PsiCapturedWildcardType) {
operandType = ((PsiCapturedWildcardType)operandType).getUpperBound();
}
if (!(operandType instanceof PsiClassType)) return false;
final PsiClassType operandClassType = (PsiClassType)operandType;