Fix the case of safe call and elvis operators: flexible types may be nullable

This commit is contained in:
Andrey Breslav
2014-06-30 15:36:46 +04:00
parent 45c1fa3741
commit 195274370f
6 changed files with 59 additions and 9 deletions
@@ -423,6 +423,9 @@ public class TypeUtils {
if (type.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
return hasNullableSuperType(type);
}
if (TypesPackage.isFlexible(type) && isNullableType(((FlexibleType) type).getUpperBound())) {
return true;
}
return false;
}