aboutsummaryrefslogtreecommitdiff
path: root/frontend/checktypes.icl
diff options
context:
space:
mode:
authormartinw2000-01-04 14:15:47 +0000
committermartinw2000-01-04 14:15:47 +0000
commit863c7d815d5cf98d90304b9ad4b77b554b6f6d35 (patch)
tree20ec9e7b330e2ccd5766c8de18109f519e1fd97b /frontend/checktypes.icl
parentcompile time pattern matching only took linearity into account but (diff)
introduced new error message: "StdDynamics not imported"
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@72 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/checktypes.icl')
-rw-r--r--frontend/checktypes.icl14
1 files changed, 12 insertions, 2 deletions
diff --git a/frontend/checktypes.icl b/frontend/checktypes.icl
index 23604b2..5fb1791 100644
--- a/frontend/checktypes.icl
+++ b/frontend/checktypes.icl
@@ -719,8 +719,18 @@ where
check_type_context :: !TypeContext !Index v:{#CheckedTypeDef} !x:{#ClassDef} !u:{#.DclModule} !*TypeHeaps !*CheckState
-> (!TypeContext,!z:{#CheckedTypeDef},!x:{#ClassDef},!w:{#DclModule},!*TypeHeaps,!*CheckState), [u v <= w, v u <= z]
- check_type_context tc=:{tc_class=tc_class=:{glob_object=class_name=:{ds_ident={id_name,id_info},ds_arity}},tc_types}
- mod_index type_defs class_defs modules heaps cs=:{cs_symbol_table}
+ check_type_context tc=:{tc_class=tc_class=:{glob_object=class_name=:{ds_ident=ds_ident=:{id_name,id_info},ds_arity}},tc_types}
+ mod_index type_defs class_defs modules heaps cs=:{cs_symbol_table, cs_predef_symbols}
+// MW..
+ #! {pds_ident} = cs_predef_symbols.[PD_TypeCodeClass]
+ pre_mod = cs_predef_symbols.[PD_PredefinedModule]
+ # (modules, cs) = case ds_ident==pds_ident of
+ True # ({dcl_name}, modules) = modules![mod_index]
+ | pre_mod.pds_def <> mod_index
+ -> (modules, { cs & cs_needed_modules = cs.cs_needed_modules bitor cNeedStdDynamics })
+ -> (modules, cs) // the predefined module does not have to import StdDynamics
+ _ -> (modules, cs)
+// .. MW
#! entry = sreadPtr id_info cs_symbol_table
# (class_index, class_module) = retrieveGlobalDefinition entry STE_Class mod_index
| class_index <> NotFound