(
self,
original_caller_type: ProperType,
callee_type: ProperType,
context: Context,
code: ErrorCode | None = None,
)
| 853 | ) |
| 854 | |
| 855 | def maybe_note_concatenate_pos_args( |
| 856 | self, |
| 857 | original_caller_type: ProperType, |
| 858 | callee_type: ProperType, |
| 859 | context: Context, |
| 860 | code: ErrorCode | None = None, |
| 861 | ) -> None: |
| 862 | # pos-only vs positional can be confusing, with Concatenate |
| 863 | if ( |
| 864 | isinstance(callee_type, CallableType) |
| 865 | and isinstance(original_caller_type, CallableType) |
| 866 | and (original_caller_type.from_concatenate or callee_type.from_concatenate) |
| 867 | ): |
| 868 | names: list[str] = [] |
| 869 | for c, o in zip( |
| 870 | callee_type.formal_arguments(), original_caller_type.formal_arguments() |
| 871 | ): |
| 872 | if None in (c.pos, o.pos): |
| 873 | # non-positional |
| 874 | continue |
| 875 | if c.name != o.name and c.name is None and o.name is not None: |
| 876 | names.append(o.name) |
| 877 | |
| 878 | if names: |
| 879 | missing_arguments = '"' + '", "'.join(names) + '"' |
| 880 | self.note( |
| 881 | f'This is likely because "{original_caller_type.name}" has named arguments: ' |
| 882 | f"{missing_arguments}. Consider marking them positional-only", |
| 883 | context, |
| 884 | code=code, |
| 885 | ) |
| 886 | |
| 887 | def invalid_index_type( |
| 888 | self, |
no test coverage detected