Check argument types [arg-type]

Mypy checks that argument types in a call match the declared argumenttypes in the signature of the called function (if one exists).

Example:

  1. from typing import List, Optional
  2.  
  3. def first(x: List[int]) -> Optional[int]:
  4. return x[0] if x else 0
  5.  
  6. t = (5, 4)
  7. # Error: Argument 1 to "first" has incompatible type "Tuple[int, int]";
  8. # expected "List[int]" [arg-type]
  9. print(first(t))