Skip to content

Commit

Permalink
Fix erasing union types
Browse files Browse the repository at this point in the history
  • Loading branch information
JukkaL committed Mar 19, 2017
1 parent 88127e0 commit a6c0ff4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mypy/erasetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def visit_typeddict_type(self, t: TypedDictType) -> Type:
return t.fallback.accept(self)

def visit_union_type(self, t: UnionType) -> Type:
return AnyType() # XXX: return underlying type if only one?
erased_items = [erase_type(item) for item in t.items]
return UnionType.make_simplified_union(erased_items)

def visit_type_type(self, t: TypeType) -> Type:
return TypeType(t.item.accept(self), line=t.line)
Expand Down

0 comments on commit a6c0ff4

Please sign in to comment.