Skip to content

Commit 5e9d657

Browse files
authored
Fix for overloaded type object erasure (#19338)
#19320 (comment)
1 parent 16e99de commit 5e9d657

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mypy/subtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ def covers_at_runtime(item: Type, supertype: Type) -> bool:
21172117
supertype = get_proper_type(supertype)
21182118

21192119
# Since runtime type checks will ignore type arguments, erase the types.
2120-
if not (isinstance(supertype, CallableType) and supertype.is_type_obj()):
2120+
if not (isinstance(supertype, FunctionLike) and supertype.is_type_obj()):
21212121
supertype = erase_type(supertype)
21222122
if is_proper_subtype(
21232123
erase_type(item), supertype, ignore_promotions=True, erase_instances=True

0 commit comments

Comments
 (0)