diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index 7782843b98f9..7ba3ff9dec45 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -157,7 +157,7 @@ def try_infer_partial_type(self, e: CallExpr) -> None: partial_types = self.chk.find_partial_types(var) if partial_types is not None and not self.chk.current_node_deferred: partial_type = cast(PartialType, var.type) - if partial_type.type is None: + if partial_type is None or partial_type.type is None: # A partial None type -> can't infer anything. return typename = partial_type.type.fullname()