From 85ea18ba46d4ee4934c325b60b111b5ac05d29da Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 21:48:15 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/error_code_list.rst | 2 +- mypy/checker.py | 2 +- mypy/message_registry.py | 2 +- test-data/unit/check-errorcodes.test | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/source/error_code_list.rst b/docs/source/error_code_list.rst index 269cfa8d2f84..9c9be815ad74 100644 --- a/docs/source/error_code_list.rst +++ b/docs/source/error_code_list.rst @@ -1165,7 +1165,7 @@ Check error code of overload function signature match 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]: + def process(response1,response2)-> Union[float,int]: return response1 + response2 Notify about an annotation in an unchecked function [annotation-unchecked] diff --git a/mypy/checker.py b/mypy/checker.py index 0f2743b2394f..c4a6b8a85870 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -768,7 +768,7 @@ def check_overlapping_overloads(self, defn: OverloadedFuncDef) -> None: continue if overload_can_never_match(sig1, sig2): - + self.msg.overloaded_signature_will_never_match(i + 1, i + j + 2, item2.func) elif not is_descriptor_get: # Note: we force mypy to check overload signatures in strict-optional mode diff --git a/mypy/message_registry.py b/mypy/message_registry.py index d50ac44bbae0..f26b0b5b2d91 100644 --- a/mypy/message_registry.py +++ b/mypy/message_registry.py @@ -366,4 +366,4 @@ def with_additional_msg(self, info: str) -> ErrorMessage: # Overloads OVERLOADED_FUNCTION_SIGNATURE: Final = ErrorMessage( "Overloaded function signature {} will never be matched", codes.OVERLOADED_FUNCTION_MATCHING -) \ No newline at end of file +) diff --git a/test-data/unit/check-errorcodes.test b/test-data/unit/check-errorcodes.test index 75df2270fdac..c762dc0a52ef 100644 --- a/test-data/unit/check-errorcodes.test +++ b/test-data/unit/check-errorcodes.test @@ -1208,8 +1208,5 @@ def process(response1: float,response2: float) -> float: 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]: +def process(response1,response2)-> Union[float,int]: return response1 + response2 - - -