MCPcopy Index your code
hub / github.com/python/mypy / visit_method_call

Method visit_method_call

mypyc/analysis/ircheck.py:390–403  ·  view source on GitHub ↗
(self, op: MethodCall)

Source from the content-addressed store, hash-verified

388 self.check_type_coercion(op, arg_value.type, arg_runtime.type)
389
390 def visit_method_call(self, op: MethodCall) -> None:
391 # Similar to above, but we must look up method first.
392 method_decl = op.receiver_type.class_ir.method_decl(op.method)
393 if method_decl.kind == FUNC_STATICMETHOD:
394 decl_index = 0
395 else:
396 decl_index = 1
397
398 if len(op.args) + decl_index != len(method_decl.sig.args):
399 self.fail(op, "Incorrect number of args for method call.")
400
401 # Skip the receiver argument (self)
402 for arg_value, arg_runtime in zip(op.args, method_decl.sig.args[decl_index:]):
403 self.check_type_coercion(op, arg_value.type, arg_runtime.type)
404
405 def visit_cast(self, op: Cast) -> None:
406 pass

Callers

nothing calls this directly

Calls 5

failMethod · 0.95
check_type_coercionMethod · 0.95
lenFunction · 0.85
zipFunction · 0.85
method_declMethod · 0.80

Tested by

no test coverage detected