Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading