Skip to content

Commit a32ad3f

Browse files
committed
Only perform deep expansion on overloads when ParamSpec is present
1 parent 3b2297f commit a32ad3f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mypy/checkexpr.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2806,12 +2806,12 @@ def has_shape(typ: Type) -> bool:
28062806
formal_to_actual = map_actuals_to_formals(
28072807
arg_kinds, arg_names, typ.arg_kinds, typ.arg_names, lambda i: arg_types[i]
28082808
)
2809-
if typ.is_generic():
2810-
typ, formal_to_actual = self.adjust_generic_callable_params_mapping(
2811-
typ, args, arg_kinds, arg_names, formal_to_actual, context
2812-
)
2813-
28142809
with self.msg.filter_errors():
2810+
if typ.is_generic() and typ.param_spec() is not None:
2811+
typ, formal_to_actual = self.adjust_generic_callable_params_mapping(
2812+
typ, args, arg_kinds, arg_names, formal_to_actual, context
2813+
)
2814+
28152815
if self.check_argument_count(
28162816
typ, arg_types, arg_kinds, arg_names, formal_to_actual, None
28172817
):

0 commit comments

Comments
 (0)