Skip to content

Commit

Permalink
FormalArgument#pos can be 0...
Browse files Browse the repository at this point in the history
  • Loading branch information
A5rocks committed Nov 25, 2021
1 parent 0769825 commit 9670d58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mypy/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,11 +1127,13 @@ def unify_generic_callable(type: CallableType, target: CallableType,
for i in range(len(target.arg_types)):
if target.arg_names[i]:
c = mypy.constraints.infer_constraints(
argument_names_map[target.arg_names[i]], target.arg_types[i], mypy.constraints.SUPERTYPE_OF)
argument_names_map[target.arg_names[i]],
target.arg_types[i],
mypy.constraints.SUPERTYPE_OF)
constraints.extend(c)
# check pos-only arguments
for arg, target_arg in zip(type.formal_arguments(), target.formal_arguments()):
if arg.pos and target_arg.pos:
if arg.pos is not None and target_arg.pos is not None:
c = mypy.constraints.infer_constraints(
arg.typ, target_arg.typ, mypy.constraints.SUPERTYPE_OF)
constraints.extend(c)
Expand Down

0 comments on commit 9670d58

Please sign in to comment.