Skip to content

Commit 1cbfab9

Browse files
committed
Poison cache in presence of assignments
1 parent 8904125 commit 1cbfab9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mypy/checkexpr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4377,6 +4377,9 @@ def check_list_multiply(self, e: OpExpr) -> Type:
43774377
return result
43784378

43794379
def visit_assignment_expr(self, e: AssignmentExpr) -> Type:
4380+
if self.overload_stack_depth > 0:
4381+
# Poison cache when we encounter assignments in overloads - they affect the binder.
4382+
self._args_cache[POISON_KEY] = []
43804383
value = self.accept(e.value)
43814384
self.chk.check_assignment(e.target, e.value)
43824385
self.chk.check_final(e)

0 commit comments

Comments
 (0)