Skip to content

Commit

Permalink
error code,update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
katconnors committed Jul 26, 2024
1 parent 22ca9cc commit 66bca55
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/source/error_code_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,23 @@ See :ref:`overloading <function-overloading>` for more explanation.

.. _code-annotation-unchecked:

Check error code of overload function signature match
--------------------------------------------------------------------------

.. code-block:: python
from typing import overload, Union
@overload
def process(response1: float,response2: float) -> float:
...
@overload
def process(response1: int,response2: int) -> int: # E: Overloaded function signature 2 will never be matched: signature 1's parameter type(s) are the same or broader [overloaded-function-matching]
...
def process(response1,response2)-> Union[float,int]:
return response1 + response2
Notify about an annotation in an unchecked function [annotation-unchecked]
--------------------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@ def overloaded_signature_will_never_match(
index1=index1, index2=index2
),
context,
code=codes.OVERLOADED_FUNCTION_MATCHING,
)

def overloaded_signatures_typevar_specific(self, index: int, context: Context) -> None:
Expand Down

0 comments on commit 66bca55

Please sign in to comment.