Skip to content

Commit 4937bf0

Browse files
committed
Address review comment
1 parent bb84384 commit 4937bf0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mypy/checkexpr.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,12 +2338,10 @@ def apply_inferred_arguments(
23382338
# Report error if some of the variables could not be solved. In that
23392339
# case assume that all variables have type Any to avoid extra
23402340
# bogus error messages.
2341-
for i, inferred_type in enumerate(inferred_args):
2341+
for inferred_type, tv in zip(inferred_args, callee_type.variables):
23422342
if not inferred_type or has_erased_component(inferred_type):
23432343
# Could not infer a non-trivial type for a type variable.
2344-
self.msg.could_not_infer_type_arguments(
2345-
callee_type, callee_type.variables[i], context
2346-
)
2344+
self.msg.could_not_infer_type_arguments(callee_type, tv, context)
23472345
inferred_args = [AnyType(TypeOfAny.from_error)] * len(inferred_args)
23482346
# Apply the inferred types to the function type. In this case the
23492347
# return type must be CallableType, since we give the right number of type

0 commit comments

Comments
 (0)