8000 Fix missing TypeInfo in --quick mode also for type aliases (#3356) · python/mypy@aeeacd7 · GitHub
[go: up one dir, main page]

Skip to content

Commit aeeacd7

Browse files
ilevkivskyigvanrossum
authored andcommitted
Fix missing TypeInfo in --quick mode also for type aliases (#3356)
Possible fix for #3355 For deserialized node with cross_ref, if we can't find the cross_ref in quick mode, then we need to put something in there, see #3304. This PR does exactly the same for the case of a type alias node.
1 parent d2638b1 commit aeeacd7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mypy/fixup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
MypyFile, SymbolNode, SymbolTable, SymbolTableNode,
77
TypeInfo, FuncDef, OverloadedFuncDef, Decorator, Var,
88
TypeVarExpr, ClassDef, Block,
9-
LDEF, MDEF, GDEF
9+
LDEF, MDEF, GDEF, TYPE_ALIAS
1010
)
1111
from mypy.types import (
1212
CallableType, EllipsisType, Instance, Overloaded, TupleType, TypedDictType,
@@ -93,8 +93,8 @@ def visit_symbol_table(self, symtab: SymbolTable) -> None:
9393
else:
9494
# We have a missing crossref in quick mode, need to put something
9595
value.node = stale_info()
96-
if value.type_override is not None:
97-
value.type_override.accept(self.type_fixer)
96+
if value.kind == TYPE_ALIAS:
97+
value.type_override = Instance(stale_info(), [])
9898
else:
9999
if isinstance(value.node, TypeInfo):
100100
# TypeInfo has no accept(). TODO: Add it?

0 commit comments

Comments
 (0)
0