Skip to content

Commit 81c7058

Browse files
committed
Always try to report missing protocol members
1 parent fb41108 commit 81c7058

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mypy/messages.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,10 +2137,6 @@ def report_protocol_problems(
21372137
}
21382138
if supertype.type.fullname in exclusions.get(type(subtype), []):
21392139
return
2140-
if any(isinstance(tp, UninhabitedType) for tp in get_proper_types(supertype.args)):
2141-
# We don't want to add notes for failed inference (e.g. Iterable[Never]).
2142-
# This will be only confusing a user even more.
2143-
return
21442140

21452141
class_obj = False
21462142
is_module = False
@@ -2197,6 +2193,11 @@ def report_protocol_problems(
21972193
# This is an obviously wrong type: too many missing members
21982194
return
21992195

2196+
if any(isinstance(tp, UninhabitedType) for tp in get_proper_types(supertype.args)):
2197+
# We don't want to add type conflict notes for failed inference (e.g. Iterable[Never]).
2198+
# This will be only confusing a user even more.
2199+
return
2200+
22002201
# Report member type conflicts
22012202
conflict_types = get_conflict_protocol_types(
22022203
subtype, supertype, class_obj=class_obj, options=self.options

0 commit comments

Comments
 (0)