(
self,
original_caller_type: ProperType,
callee_type: ProperType,
context: Context,
parent_error: ErrorInfo,
)
| 816 | return error |
| 817 | |
| 818 | def incompatible_argument_note( |
| 819 | self, |
| 820 | original_caller_type: ProperType, |
| 821 | callee_type: ProperType, |
| 822 | context: Context, |
| 823 | parent_error: ErrorInfo, |
| 824 | ) -> None: |
| 825 | if self.prefer_simple_messages(): |
| 826 | return |
| 827 | if isinstance( |
| 828 | original_caller_type, (Instance, TupleType, TypedDictType, TypeType, CallableType) |
| 829 | ): |
| 830 | if isinstance(callee_type, Instance) and callee_type.type.is_protocol: |
| 831 | self.report_protocol_problems( |
| 832 | original_caller_type, callee_type, context, parent_error=parent_error |
| 833 | ) |
| 834 | if isinstance(callee_type, UnionType): |
| 835 | for item in callee_type.items: |
| 836 | item = get_proper_type(item) |
| 837 | if isinstance(item, Instance) and item.type.is_protocol: |
| 838 | self.report_protocol_problems( |
| 839 | original_caller_type, item, context, parent_error=parent_error |
| 840 | ) |
| 841 | if isinstance(callee_type, CallableType) and isinstance(original_caller_type, Instance): |
| 842 | call = find_member( |
| 843 | "__call__", original_caller_type, original_caller_type, is_operator=True |
| 844 | ) |
| 845 | if call: |
| 846 | self.note_call(original_caller_type, call, context, code=parent_error.code) |
| 847 | if isinstance(callee_type, Instance) and callee_type.type.is_protocol: |
| 848 | call = find_member("__call__", callee_type, callee_type, is_operator=True) |
| 849 | if call: |
| 850 | self.note_call(callee_type, call, context, code=parent_error.code) |
| 851 | self.maybe_note_concatenate_pos_args( |
| 852 | original_caller_type, callee_type, context, parent_error.code |
| 853 | ) |
| 854 | |
| 855 | def maybe_note_concatenate_pos_args( |
| 856 | self, |
no test coverage detected