diff --git a/mypy/checker.py b/mypy/checker.py index 841b3a905c65..7c54d99e0afe 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -8751,8 +8751,9 @@ def is_unsafe_overlapping_overload_signatures( # Note: We repeat this check twice in both directions compensate for slight # asymmetries in 'is_callable_compatible'. + other_expanded = expand_callable_variants(other) for sig_variant in expand_callable_variants(signature): - for other_variant in expand_callable_variants(other): + for other_variant in other_expanded: # Using only expanded callables may cause false negatives, we can add # more variants (e.g. using inference between callables) in the future. if is_subset_no_promote(sig_variant.ret_type, other_variant.ret_type):