Closed
Description
Consider these two files:
# sam1.py
f = 'a'
f = 'b'
# sam2.py
f = 1
reveal_type(f)
Running python3 -m mypy --scripts-are-modules sam2.py sam1.py
(note the order; it seems mypy processes the files in reverse order) produces
sam2.py:2: error: Revealed type is 'builtins.None'
I'm pretty sure this is due to old typestate left in the binder, because deleting the second assignment in sam1.py
makes the problem go away. (And we don't populate the binder on the initial assignment to a variable: #2008.)
Metadata
Metadata
Assignees
Labels
No labels