Fix nullability check (in case of explicitly nullable types constructed from ype variables)

This commit is contained in:
Alexey Sedunov
2013-02-13 18:15:23 +04:00
parent fc62a7dfa0
commit 1f8d42ab49
3 changed files with 19 additions and 1 deletions
@@ -286,9 +286,12 @@ public class CodegenUtil {
* @return true if a value of this type can be null
*/
public static boolean isNullableType(@NotNull JetType type) {
if (type.isNullable()) {
return true;
}
if (type.getConstructor().getDeclarationDescriptor() instanceof TypeParameterDescriptor) {
return TypeUtils.hasNullableSuperType(type);
}
return type.isNullable();
return false;
}
}