Skip to content

Commit 3d918b3

Browse files
committed
Substitute bounds of type parameters when retrieving functions
1 parent c03cd70 commit 3d918b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ir/ast.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,16 @@ def get_callable_functions(self, class_decls) -> Set[FunctionDeclaration]:
659659
new_p.param_type = types.substitute_type(p.get_type(),
660660
type_var_map)
661661
params.append(new_p)
662+
type_params = []
663+
for t_param in f.type_parameters:
664+
new_tparam = deepcopy(t_param)
665+
if new_tparam.bound:
666+
new_tparam.bound = types.substitute_type(t_param.bound,
667+
type_var_map)
668+
type_params.append(new_tparam)
662669
ret_type = types.substitute_type(f.get_type(),
663670
type_var_map)
671+
new_f.type_parameters = type_params
664672
new_f.params = params
665673
new_f.inferred_type = ret_type
666674
new_f.ret_type = ret_type

0 commit comments

Comments
 (0)