aboutsummaryrefslogtreecommitdiff
path: root/frontend/comparedefimp.icl
diff options
context:
space:
mode:
authorsjakie2003-06-06 14:29:56 +0000
committersjakie2003-06-06 14:29:56 +0000
commit99992f5784da623a11a5a76c86fda1fb930e9f78 (patch)
treeda598e4e8a19fff4a2e06a58f95f8c4436d93696 /frontend/comparedefimp.icl
parentrenamed field names of type Ident in syntax tree (diff)
Bug fixs in universally quantified types: Attribute variables of universal type variables in type definitions were not initialized properly.
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1341 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/comparedefimp.icl')
-rw-r--r--frontend/comparedefimp.icl17
1 files changed, 17 insertions, 0 deletions
diff --git a/frontend/comparedefimp.icl b/frontend/comparedefimp.icl
index 6b918c1..2bc1140 100644
--- a/frontend/comparedefimp.icl
+++ b/frontend/comparedefimp.icl
@@ -231,6 +231,23 @@ where
= compare dclDef iclDef comp_st
compare (TV dclVar) (TV iclVar) comp_st
= compare dclVar iclVar comp_st
+ compare (TFA dclvars dcltype) (TFA iclvars icltype) comp_st=:{comp_type_var_heap}
+ # comp_type_var_heap = initialyseATypeVars dclvars iclvars comp_type_var_heap
+ (ok, comp_st) = compare dcltype icltype { comp_st & comp_type_var_heap = comp_type_var_heap }
+ type_heaps = foldSt clear_type_var dclvars (comp_st.comp_type_var_heap, comp_st.comp_attr_var_heap)
+ (comp_type_var_heap, comp_attr_var_heap) = foldSt clear_type_var iclvars type_heaps
+ = (ok, { comp_st & comp_type_var_heap = comp_type_var_heap, comp_attr_var_heap = comp_attr_var_heap })
+ where
+ clear_type_var {atv_variable={tv_info_ptr}, atv_attribute} (type_var_heap,attr_var_heap)
+ = (type_var_heap <:= (tv_info_ptr, TVI_Empty), clear_attr_var atv_attribute attr_var_heap)
+
+ clear_attr_var (TA_Var {av_info_ptr}) attr_var_heap
+ = attr_var_heap <:= (av_info_ptr, AVI_Empty)
+ clear_attr_var (TA_RootVar {av_info_ptr}) attr_var_heap
+ = attr_var_heap <:= (av_info_ptr, AVI_Empty)
+ clear_attr_var attr attr_var_heap
+ = attr_var_heap
+
compare _ _ comp_st
= (False, comp_st)