Skip to content

Commit

Permalink
Fix type check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JukkaL committed Jul 15, 2014
1 parent a5f3306 commit 88a7b11
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,16 +684,17 @@ def check_and_set_up_type_alias(self, s: AssignmentStmt) -> None:
and not s.type):
lvalue = s.lvalues[0]
if isinstance(lvalue, NameExpr):
if not s.lvalues[0].is_def:
if not lvalue.is_def:
# Only a definition can create a type alias, not regular assignment.
return
rvalue = s.rvalue
if isinstance(rvalue, RefExpr):
if isinstance(rvalue.node, TypeInfo):
node = rvalue.node
if isinstance(node, TypeInfo):
# TODO: We should record the fact that this is a variable
# that refers to a type, rather than making this
# just an alias for the type.
self.globals[lvalue.name].node = rvalue.node
self.globals[lvalue.name].node = node

def analyse_lvalue(self, lval: Node, nested: bool = False,
add_global: bool = False,
Expand Down

0 comments on commit 88a7b11

Please sign in to comment.