From 81c7058c0da8da6f76099ce8402b1af9c4c1ed2e Mon Sep 17 00:00:00 2001 From: Gatsik <74517072+Gatsik@users.noreply.github.com> Date: Wed, 13 Aug 2025 21:37:20 +0300 Subject: [PATCH] Always try to report missing protocol members --- mypy/messages.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mypy/messages.py b/mypy/messages.py index 571cebb1b174..79c040a4239b 100644 --- a/mypy/messages.py +++ b/mypy/messages.py @@ -2137,10 +2137,6 @@ def report_protocol_problems( } if supertype.type.fullname in exclusions.get(type(subtype), []): return - if any(isinstance(tp, UninhabitedType) for tp in get_proper_types(supertype.args)): - # We don't want to add notes for failed inference (e.g. Iterable[Never]). - # This will be only confusing a user even more. - return class_obj = False is_module = False @@ -2197,6 +2193,11 @@ def report_protocol_problems( # This is an obviously wrong type: too many missing members return + if any(isinstance(tp, UninhabitedType) for tp in get_proper_types(supertype.args)): + # We don't want to add type conflict notes for failed inference (e.g. Iterable[Never]). + # This will be only confusing a user even more. + return + # Report member type conflicts conflict_types = get_conflict_protocol_types( subtype, supertype, class_obj=class_obj, options=self.options