aboutsummaryrefslogtreecommitdiff
path: root/frontend/type.icl
diff options
context:
space:
mode:
authorjohnvg2013-03-25 11:03:54 +0000
committerjohnvg2013-03-25 11:03:54 +0000
commitba03f56092e609a7f25a78ff9a5d6e69f3c0ee2c (patch)
tree1c768fc1f33430bc97cbcaa0802d9fffd0c80e1a /frontend/type.icl
parentrestore some code for reopening files that was accidently removed (diff)
fix freshCopy of TFA var (cv :@: types), (cv :@: types) was not copied in this case
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@2212 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/type.icl')
-rw-r--r--frontend/type.icl16
1 files changed, 7 insertions, 9 deletions
diff --git a/frontend/type.icl b/frontend/type.icl
index 684cca0..1cc292b 100644
--- a/frontend/type.icl
+++ b/frontend/type.icl
@@ -642,15 +642,6 @@ freshConsVariable {tv_info_ptr} type_var_heap
instance freshCopy AType
where
- freshCopy type=:{at_type = cv :@: types, at_attribute} type_heaps=:{th_attrs}
- # (fresh_attribute, th_attrs) = freshCopyOfTypeAttribute at_attribute th_attrs
- # (fresh_types, type_heaps) = freshCopy types { type_heaps & th_attrs = th_attrs }
- = case cv of
- CV tv
- # (fresh_cons_var, th_vars) = freshConsVariable tv type_heaps.th_vars
- -> ({type & at_type = fresh_cons_var :@: fresh_types, at_attribute = fresh_attribute }, { type_heaps & th_vars = th_vars })
- _
- -> ({type & at_type = cv :@: fresh_types, at_attribute = fresh_attribute}, type_heaps)
freshCopy type=:{at_type, at_attribute} type_heaps=:{th_attrs}
# (fresh_attribute, th_attrs) = freshCopyOfTypeAttribute at_attribute th_attrs
(fresh_type, type_heaps) = freshCopy at_type { type_heaps & th_attrs = th_attrs }
@@ -670,6 +661,13 @@ where
# (arg_type, type_heaps) = freshCopy arg_type type_heaps
(res_type, type_heaps) = freshCopy res_type type_heaps
= (arg_type --> res_type, type_heaps)
+ freshCopy (CV tv :@: types) type_heaps
+ # (fresh_types, type_heaps) = freshCopy types type_heaps
+ # (fresh_cons_var, th_vars) = freshConsVariable tv type_heaps.th_vars
+ = (fresh_cons_var :@: fresh_types, {type_heaps & th_vars = th_vars})
+ freshCopy (cv :@: types) type_heaps
+ # (fresh_types, type_heaps) = freshCopy types type_heaps
+ = (cv :@: fresh_types, type_heaps)
freshCopy (TArrow1 arg_type) type_heaps
# (arg_type, type_heaps) = freshCopy arg_type type_heaps
= (TArrow1 arg_type, type_heaps)