Skip to content

Commit 93f096d

Browse files
JamesGuthrieJukkaL
authored andcommitted
Add SameTypeVisitor.visit_overloaded() implementation
part of #730
1 parent 0e17a92 commit 93f096d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mypy/sametypes.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from mypy.types import (
44
Type, UnboundType, ErrorType, AnyType, NoneTyp, Void, TupleType, UnionType, CallableType,
5-
TypeVarType, Instance, TypeVisitor, ErasedType, TypeList
5+
TypeVarType, Instance, TypeVisitor, ErasedType, TypeList, Overloaded
66
)
77

88

@@ -91,3 +91,10 @@ def visit_union_type(self, left: UnionType) -> bool:
9191
return is_same_types(left.items, cast(UnionType, self.right).items)
9292
else:
9393
return False
94+
95+
def visit_overloaded(self, left: Overloaded) -> bool:
96+
if isinstance(self.right, Overloaded):
97+
return is_same_types(cast(List[Type], left.items()),
98+
cast(List[Type], cast(Overloaded, self.right).items()))
99+
else:
100+
return False

0 commit comments

Comments
 (0)