Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mypy/fixup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def visit_symbol_table(self, symtab: SymbolTable) -> None:
if stnode is not None:
value.node = stnode.node
value.type_override = stnode.type_override
if (self.quick_and_dirty and value.kind == TYPE_ALIAS and
stnode.type_override is None):
value.type_override = Instance(stale_info(), [])
value.alias_tvars = stnode.alias_tvars or []
elif not self.quick_and_dirty:
assert stnode is not None, "Could not find cross-ref %s" % (cross_ref,)
Expand Down
23 changes: 23 additions & 0 deletions test-data/unit/check-incremental.test
Original file line number Diff line number Diff line change
Expand Up @@ -2707,6 +2707,29 @@ b.x.y
tmp/c.py:2: error: Revealed type is '<stale cache: consider running mypy without --quick>'
tmp/c.py:5: error: "<stale cache: consider running mypy without --quick>" has no attribute "y"

[case testNoCrashOnDoubleImportAliasQuick]
# cmd: mypy -m e
# cmd2: mypy -m c
# cmd3: mypy -m e
# flags: --quick
[file c.py]
from typing import List
Alias = List[int]
[file c.py.2]
from typing import List
Alias = int

[file d.py]
from c import Alias

[file e.py]
from d import Alias
[file e.py.3]
from d import Alias
x: Alias
[out3]
[builtins fixtures/list.pyi]

[case testSerializeAbstractPropertyIncremental]
from abc import abstractmethod
import typing
Expand Down