@@ -218,15 +218,19 @@ def visit_call_expr(self, e: CallExpr, allow_none_return: bool = False) -> Type:
218
218
and isinstance (e .callee , MemberExpr )
219
219
and isinstance (callee_type , FunctionLike )):
220
220
callee_expr_type = self .chk .type_map .get (e .callee .expr )
221
- if isinstance (callee_expr_type , TypedDictType ):
221
+ info = None
222
+ # TODO: Support fallbacks of other kinds of types as well?
223
+ if isinstance (callee_expr_type , Instance ):
224
+ info = callee_expr_type .type
225
+ elif isinstance (callee_expr_type , TypedDictType ):
222
226
info = callee_expr_type .fallback .type .get_containing_type_info (e .callee .name )
223
- if info :
224
- fullname = '{}.{}' .format (info .fullname (), e .callee .name )
225
- object_type = callee_expr_type
226
- signature_hook = self .plugin .get_method_signature_hook (fullname )
227
- if signature_hook :
228
- callee_type = self .apply_method_signature_hook (
229
- e , callee_type , object_type , signature_hook )
227
+ if info :
228
+ fullname = '{}.{}' .format (info .fullname (), e .callee .name )
229
+ object_type = callee_expr_type
230
+ signature_hook = self .plugin .get_method_signature_hook (fullname )
231
+ if signature_hook :
232
+ callee_type = self .apply_method_signature_hook (
233
+ e , callee_type , object_type , signature_hook )
230
234
ret_type = self .check_call_expr_with_callee_type (callee_type , e , fullname , object_type )
231
235
if isinstance (ret_type , UninhabitedType ):
232
236
self .chk .binder .unreachable ()
0 commit comments