Skip to content

Commit

Permalink
Add SameTypeVisitor.visit_overloaded() implementation
Browse files Browse the repository at this point in the history
part of python#730
  • Loading branch information
JamesGuthrie committed Aug 24, 2015
1 parent 9225437 commit 93c2b80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mypy/sametypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from mypy.types import (
Type, UnboundType, ErrorType, AnyType, NoneTyp, Void, TupleType, UnionType, CallableType,
TypeVarType, Instance, TypeVisitor, ErasedType, TypeList
TypeVarType, Instance, TypeVisitor, ErasedType, TypeList, Overloaded
)


Expand Down Expand Up @@ -91,3 +91,9 @@ def visit_union_type(self, left: UnionType) -> bool:
return is_same_types(left.items, cast(UnionType, self.right).items)
else:
return False

def visit_overloaded(self, left: Overloaded) -> bool:
if isinstance(self.right, Overloaded):
return is_same_types(cast(List[Type], left.items()), cast(List[Type], cast(Overloaded, self.right).items()))
else:
return False

0 comments on commit 93c2b80

Please sign in to comment.