Skip to content

Commit ab1e450

Browse files
use is_protocol rather than runtime_protocol since the runtime-checkable test should be performed elsewhere.
1 parent d388ec9 commit ab1e450

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8022,7 +8022,7 @@ def conditional_types(
80228022
return default, UninhabitedType()
80238023
elif ( # handle structural subtypes
80248024
isinstance(proposed_type, CallableType)
8025-
or (isinstance(proposed_type, Instance) and proposed_type.type.runtime_protocol)
8025+
or (isinstance(proposed_type, Instance) and proposed_type.type.is_protocol)
80268026
) and is_subtype(current_type, proposed_type, ignore_promotions=True):
80278027
return default, UninhabitedType()
80288028
elif not is_overlapping_types(current_type, proposed_type, ignore_promotions=True):

0 commit comments

Comments
 (0)