@@ -132,11 +132,7 @@ def visit_call_expr(self, e: CallExpr) -> Type:
132
132
# It's really a special form that only looks like a call.
133
133
return self .accept (e .analyzed , self .chk .type_context [- 1 ])
134
134
self .try_infer_partial_type (e )
135
- self .accept (e .callee )
136
- # Access callee type directly, since accept may return the Any type
137
- # even if the type is known (in a dynamically typed function). This
138
- # way we get a more precise callee in dynamically typed functions.
139
- callee_type = self .chk .type_map [e .callee ]
135
+ callee_type = self .accept (e .callee )
140
136
if (self .chk .disallow_untyped_calls and
141
137
self .chk .typing_mode_full () and
142
138
isinstance (callee_type , CallableType )
@@ -238,9 +234,8 @@ def check_call(self, callee: Type, args: List[Node],
238
234
arg_types = self .infer_arg_types_in_context2 (
239
235
callee , args , arg_kinds , formal_to_actual )
240
236
241
- if not self .chk .typing_mode_none ():
242
- self .check_argument_count (callee , arg_types , arg_kinds ,
243
- arg_names , formal_to_actual , context , self .msg )
237
+ self .check_argument_count (callee , arg_types , arg_kinds ,
238
+ arg_names , formal_to_actual , context , self .msg )
244
239
245
240
self .check_argument_types (arg_types , arg_kinds , callee ,
246
241
formal_to_actual , context ,
0 commit comments