Skip to content

Commit cc99a6c

Browse files
committed
protocol
1 parent 975fbe5 commit cc99a6c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mypy/checkmember.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,11 @@ def analyze_var(
783783
call_type = get_proper_type(_analyze_member_access("__call__", typ, mx))
784784
else:
785785
call_type = typ
786-
if isinstance(call_type, Instance) and call_type.type.get_method("__call__"):
786+
if (
787+
isinstance(call_type, Instance)
788+
and call_type.type.is_protocol
789+
and call_type.type.get_method("__call__")
790+
):
787791
call_type = get_proper_type(_analyze_member_access("__call__", typ, mx))
788792

789793
if isinstance(call_type, FunctionLike) and not call_type.is_type_obj():

0 commit comments

Comments
 (0)