Skip to content

Commit 8729faa

Browse files
committed
Ignore function whose type parameter have wildcard bounds
1 parent 2c49751 commit 8729faa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/generators/generator.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,9 +2394,12 @@ def _get_matching_objects(self,
23942394
if bound is None:
23952395
continue
23962396
if bound.has_type_variables():
2397-
bound = tp.substitute_type(
2398-
bound, type_map_var)
2399-
if func_type_var_map.get(
2397+
# Substitute the bound of the function type
2398+
# parameter with type assignment map of the
2399+
# receiver class.
2400+
bound = tp.substitute_type(bound, type_map_var)
2401+
is_wildcard = bound.is_wildcard()
2402+
if is_wildcard or func_type_var_map.get(
24002403
t_param, bound) != bound:
24012404
continue
24022405
if not bound.has_type_variables():

0 commit comments

Comments
 (0)