aboutsummaryrefslogtreecommitdiff
path: root/frontend/checktypes.icl
diff options
context:
space:
mode:
authorjohnvg2011-04-15 13:27:17 +0000
committerjohnvg2011-04-15 13:27:17 +0000
commit07421cdc9f40418c2896a0a77f5e038904ac6059 (patch)
tree465d9c9e9003b51c915d11fa570d44910c63c3c9 /frontend/checktypes.icl
parentremove field icl_copied_from_dcl from type IclModule (diff)
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1926 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/checktypes.icl')
-rw-r--r--frontend/checktypes.icl16
1 files changed, 8 insertions, 8 deletions
diff --git a/frontend/checktypes.icl b/frontend/checktypes.icl
index b5e350d..a81e44c 100644
--- a/frontend/checktypes.icl
+++ b/frontend/checktypes.icl
@@ -772,9 +772,9 @@ checkOpenType mod_index scope dem_attr type cot_state
checkOpenATypes mod_index scope types cot_state
= mapSt (checkOpenAType mod_index scope DAK_None) types cot_state
-checkInstanceType :: !Index !(Global DefinedSymbol) !InstanceType !Specials !u:{# CheckedTypeDef} !v:{# ClassDef} !u:{# DclModule} !*TypeHeaps !*CheckState
- -> (!InstanceType, !Specials, !u:{# CheckedTypeDef}, !v:{# ClassDef}, !u:{# DclModule}, !*TypeHeaps, !*CheckState)
-checkInstanceType mod_index ins_class it=:{it_types,it_context} specials type_defs class_defs modules heaps cs
+checkInstanceType :: !Index !GlobalIndex !ClassIdent !InstanceType !Specials !u:{# CheckedTypeDef} !v:{# ClassDef} !u:{# DclModule} !*TypeHeaps !*CheckState
+ -> (!InstanceType,!Specials,!u:{# CheckedTypeDef},!v:{# ClassDef},!u:{# DclModule},!*TypeHeaps,!*CheckState)
+checkInstanceType mod_index ins_class_index ins_class_ident it=:{it_types,it_context} specials type_defs class_defs modules heaps cs
# cs_error = check_fully_polymorphity it_types it_context cs.cs_error
ots = { ots_type_defs = type_defs, ots_modules = modules }
oti = { oti_heaps = heaps, oti_all_vars = [], oti_all_attrs = [], oti_global_vars= [] }
@@ -783,7 +783,7 @@ checkInstanceType mod_index ins_class it=:{it_types,it_context} specials type_de
(heaps, cs) = check_linearity_of_type_vars it_vars oti.oti_heaps cs
oti = { oti & oti_all_vars = [], oti_all_attrs = [], oti_heaps = heaps }
(it_context, type_defs, class_defs, modules, heaps, cs) = checkTypeContexts it_context mod_index class_defs ots oti cs
- cs_error = foldSt (compare_context_and_instance_types ins_class it_types) it_context cs.cs_error
+ cs_error = foldSt (compare_context_and_instance_types ins_class_index ins_class_ident it_types) it_context cs.cs_error
(specials, cs) = checkSpecialTypeVars specials { cs & cs_error = cs_error }
cs_symbol_table = removeVariablesFromSymbolTable cGlobalScope it_vars cs.cs_symbol_table
cs_symbol_table = removeAttributesFromSymbolTable it_attr_vars cs_symbol_table
@@ -809,15 +809,15 @@ checkInstanceType mod_index ins_class it=:{it_types,it_context} specials type_de
= (th_vars, checkError tv_ident ": this type variable occurs more than once in an instance type" error)
= (th_vars, error)
- compare_context_and_instance_types ins_class it_types {tc_class=TCGeneric _, tc_types} cs_error
+ compare_context_and_instance_types ins_class_index ins_class_ident it_types {tc_class=TCGeneric _, tc_types} cs_error
= cs_error
- compare_context_and_instance_types ins_class it_types {tc_class=TCClass clazz, tc_types} cs_error
- | ins_class<>clazz
+ compare_context_and_instance_types ins_class_index ins_class_ident it_types {tc_class=TCClass clazz, tc_types} cs_error
+ | ins_class_index.gi_module<>clazz.glob_module || ins_class_index.gi_index<>clazz.glob_object.ds_index
= cs_error
# are_equal
= fold2St compare_context_and_instance_type it_types tc_types True
| are_equal
- = checkError ins_class.glob_object.ds_ident "context restriction equals instance type" cs_error
+ = checkError ins_class_ident.ci_ident "context restriction equals instance type" cs_error
= cs_error
where
compare_context_and_instance_type (TA {type_index=ti1} _) (TA {type_index=ti2} _) are_equal_accu