Skip to content

Commit 31a61a2

Browse files
committed
use is_same_type for symmetry
1 parent 7f48f4d commit 31a61a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def handle_recursive_union(template: UnionType, actual: Type, direction: int) ->
507507
non_type_var_items = [t for t in template.items if not isinstance(t, TypeVarType)]
508508
type_var_items = [t for t in template.items if isinstance(t, TypeVarType)]
509509
ret = infer_constraints(UnionType.make_union(non_type_var_items), actual, direction)
510-
if ret or any(mypy.subtypes.is_subtype(t, actual) for t in non_type_var_items):
510+
if ret or any(mypy.subtypes.is_same_type(t, actual) for t in non_type_var_items):
511511
return ret
512512
ret = infer_constraints(UnionType.make_union(type_var_items), actual, direction)
513513
return ret

0 commit comments

Comments
 (0)