aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnvg2016-10-04 10:31:20 +0000
committerjohnvg2016-10-04 10:31:20 +0000
commitf558391f09d40fa1a84cde1fc5db6ddb8b153fad (patch)
treef5ddc1f7810206a77c10e184803a21b11544adb7
parentdon't use freopen with Visual Studio, to prevent crashes (diff)
fix substitution of universally quantified uniqueness attributes in function determineTypeOfMemberInstance,
to prevent compiler crash for: :: T m a = T (m (a, a)) derive bimap T, (,) git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2744 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/check.icl16
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/check.icl b/frontend/check.icl
index 36b797f..6a0a881 100644
--- a/frontend/check.icl
+++ b/frontend/check.icl
@@ -400,14 +400,13 @@ where
# (new_info_ptr, th_vars) = newPtr TVI_Empty type_heaps.th_vars
new_fv = { atv_variable & tv_info_ptr = new_info_ptr}
th_vars = th_vars <:= (atv_variable.tv_info_ptr, TVI_Type (TV new_fv))
- (new_attr, th_attrs) = build_attr_subst atv_attribute type_heaps.th_attrs
+ (new_attr, th_attrs) = subst_attr atv_attribute type_heaps.th_attrs
= ([ { atv & atv_variable = new_fv, atv_attribute = new_attr } : free_vars], { type_heaps & th_vars = th_vars, th_attrs = th_attrs })
- where
- build_attr_subst (TA_Var avar) attr_var_heap
- # (new_info_ptr, attr_var_heap) = newPtr AVI_Empty attr_var_heap
- new_attr = { avar & av_info_ptr = new_info_ptr}
- = (TA_Var new_attr, attr_var_heap <:= (avar.av_info_ptr, AVI_Attr (TA_Var new_attr)))
- build_attr_subst attr attr_var_heap
+ where
+ subst_attr (TA_Var {av_info_ptr}) attr_var_heap
+ # (AVI_Attr ta_var_new_attr, attr_var_heap) = readPtr av_info_ptr attr_var_heap
+ = (ta_var_new_attr, attr_var_heap)
+ subst_attr attr attr_var_heap
= (attr, attr_var_heap)
build_attr_var_subst attr (free_attrs, attr_var_heap)
@@ -3511,11 +3510,11 @@ reverseDAG { dag_nr_of_nodes, dag_get_children }
# children
= dag_get_children parent_node_nr
= foldSt (reverse_arrow parent_node_nr) children reversed_children
+
reverse_arrow parent_node_nr child_node_nr reversed_children
# (current_parents, reversed_children)
= reversed_children![child_node_nr]
= { reversed_children & [child_node_nr] = [parent_node_nr : current_parents] }
-
groupify :: !DAG !{#ComponentNr} !Int -> .{![ComponentNr]}
groupify { dag_nr_of_nodes, dag_get_children } component_numbers nr_of_components
@@ -3534,6 +3533,7 @@ groupify { dag_nr_of_nodes, dag_get_children } component_numbers nr_of_component
visited_array
= foldSt (\i visited_array->{ visited_array & [i] = False }) visited_list visited_array
= (visited_array, node_to_components)
+
groupifyPerArrow :: !{#ComponentNr} !Int !Int !(!*{#Bool}, ![Int], !*{![ComponentNr]})
-> (!.{#Bool}, ![Int], !.{![ComponentNr]})
groupifyPerArrow component_numbers node_nr child_node_nr (visited_array, visited_list, node_to_components)