aboutsummaryrefslogtreecommitdiff
path: root/frontend/type.icl
diff options
context:
space:
mode:
authordiederik2002-10-07 08:32:48 +0000
committerdiederik2002-10-07 08:32:48 +0000
commitecdced89e979ee154cfc956f3166dd293978a137 (patch)
tree471082fc80103157ee6c00222c842f1ad9b66c9d /frontend/type.icl
parentminor changes in generics (diff)
clear type propagation info from var heap
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1215 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/type.icl')
-rw-r--r--frontend/type.icl19
1 files changed, 19 insertions, 0 deletions
diff --git a/frontend/type.icl b/frontend/type.icl
index af77645..a8a0e6c 100644
--- a/frontend/type.icl
+++ b/frontend/type.icl
@@ -2178,6 +2178,7 @@ typeProgram comps main_dcl_module_n fun_defs specials list_inferred_types icl_de
ali_tail_strict_list_first_instance_indices=tail_strict_list_first_instance_indices,
ali_instances_range={ ir_from = fun_env_size, ir_to = special_instances.si_next_array_member_index }
}
+ # ts_var_heap = clear_var_heap ti_functions ts_var_heap
= (not type_error, fun_defs, array_and_list_instances, type_code_instances, ti_common_defs, ti_functions,
ts_td_infos, {hp_var_heap = ts_var_heap, hp_expression_heap = ts_expr_heap, hp_type_heaps = ts_type_heaps, hp_generic_heap=ts_generic_heap },
predef_symbols, ts_error.ea_file, out)
@@ -2745,6 +2746,24 @@ where
CheckedType _
-> ts
+ clear_var_heap fun_types var_heap
+ = mapArraySt clear_module fun_types var_heap
+ where
+ clear_module module_types var_heap
+ = mapArraySt clear_function module_types var_heap
+ clear_function {ft_type_ptr} var_heap
+ | isNilPtr ft_type_ptr
+ = var_heap
+ = var_heap <:= (ft_type_ptr, VI_Empty)
+
+mapArraySt f a s :== map_a_st 0 a s
+where
+ map_a_st i a st
+ | i==size a
+ = st
+ # (ai, a) = a![i]
+ = map_a_st (i+1) a (f ai st)
+
is_rare_name {id_name}
= id_name.[0]=='_'