diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index c186ab1434ef..40204e7c9ccf 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -2849,6 +2849,7 @@ def visit_assignment_expr(self, e: AssignmentExpr) -> Type: value = self.accept(e.value) self.chk.check_assignment(e.target, e.value) self.chk.check_final(e) + self.chk.store_type(e.target, value) self.find_partial_type_ref_fast_path(e.target) return value @@ -3903,9 +3904,6 @@ def accept(self, assert typ is not None self.chk.store_type(node, typ) - if isinstance(node, AssignmentExpr) and not has_uninhabited_component(typ): - self.chk.store_type(node.target, typ) - if (self.chk.options.disallow_any_expr and not always_allow_any and not self.chk.is_stub and
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: