diff --git a/python/src/com/jetbrains/python/psi/impl/PyQualifiedReferenceImpl.java b/python/src/com/jetbrains/python/psi/impl/PyQualifiedReferenceImpl.java index d9fe216c9398..ff1878472a03 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyQualifiedReferenceImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyQualifiedReferenceImpl.java @@ -133,7 +133,7 @@ public class PyQualifiedReferenceImpl extends PyReferenceImpl { PyExpression qualifier = myElement.getQualifier(); assert qualifier != null; - PyType qualifierType = qualifier.getType(TypeEvalContext.variants()); + PyType qualifierType = qualifier.getType(TypeEvalContext.slow()); ProcessingContext ctx = new ProcessingContext(); final Set namesAlready = new HashSet(); ctx.put(PyType.CTX_NAMES, namesAlready); diff --git a/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java b/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java index 6d01c1af1562..3ecf83d243ab 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java @@ -280,7 +280,7 @@ public class PyReferenceExpressionImpl extends PyElementImpl implements PyRefere if (defs.length > 0) { PyType type = getTypeIfExpr(defs[0], context); for (int i = 1; i < defs.length; i++) { - type = PyUnionType.union(type, getTypeIfExpr(defs[i], context), context.allowNulls()); + type = PyUnionType.union(type, getTypeIfExpr(defs[i], context)); } return type; } diff --git a/python/src/com/jetbrains/python/psi/types/PyUnionType.java b/python/src/com/jetbrains/python/psi/types/PyUnionType.java index 0dcb5b41f878..7d602e88c7cb 100644 --- a/python/src/com/jetbrains/python/psi/types/PyUnionType.java +++ b/python/src/com/jetbrains/python/psi/types/PyUnionType.java @@ -55,19 +55,6 @@ public class PyUnionType implements PyType { }, ", ") + ")"; } - @Nullable - public static PyType union(PyType type1, PyType type2, boolean allowNulls) { - if (allowNulls) { - if (type1 == null) { - return type2; - } - if (type2 == null) { - return type1; - } - } - return union(type1, type2); - } - @Nullable public static PyType union(PyType type1, PyType type2) { if (type1 instanceof PyTupleType && type2 instanceof PyTupleType) { diff --git a/python/src/com/jetbrains/python/psi/types/TypeEvalContext.java b/python/src/com/jetbrains/python/psi/types/TypeEvalContext.java index 8fb9590b005a..a520a49a7ab2 100644 --- a/python/src/com/jetbrains/python/psi/types/TypeEvalContext.java +++ b/python/src/com/jetbrains/python/psi/types/TypeEvalContext.java @@ -11,7 +11,6 @@ import java.util.Map; */ public class TypeEvalContext { private boolean myAllowDataFlow; - private boolean allowNulls = false; private Map myEvaluated = new HashMap(); @@ -27,15 +26,6 @@ public class TypeEvalContext { return myAllowDataFlow; } - - public static TypeEvalContext variants() { - TypeEvalContext context = slow(); - context.allowNulls = true; - - return context; - } - - public static TypeEvalContext slow() { return new TypeEvalContext(true); } @@ -53,8 +43,4 @@ public class TypeEvalContext { myEvaluated.put(expr, result); return result; } - - public boolean allowNulls() { - return allowNulls; - } }