diff options
author | martijnv | 2003-02-10 10:04:14 +0000 |
---|---|---|
committer | martijnv | 2003-02-10 10:04:14 +0000 |
commit | 7fa3b49d1200c346af3b5a0ab63f2a45b61a8b90 (patch) | |
tree | 4c6c31f6ca7d11ed6e0a7b6f2afbb2c9e181071a /frontend/checktypes.icl | |
parent | - bug fix: error for abstract datatypes in dynamic types. (diff) |
- bug fix: generate an error for abstract datatypes in dynamic types
(predefined abstract types such as Arrays in dynamic types are now
approved).
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1318 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/checktypes.icl')
-rw-r--r-- | frontend/checktypes.icl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/checktypes.icl b/frontend/checktypes.icl index 7bc7072..7ee610c 100644 --- a/frontend/checktypes.icl +++ b/frontend/checktypes.icl @@ -432,9 +432,9 @@ checkArityOfType act_arity form_arity (SynType _) checkArityOfType act_arity form_arity _ = form_arity >= act_arity -checkAbstractType (AbstractType _) = True -checkAbstractType (AbstractSynType _ _) = True -checkAbstractType _ = False +checkAbstractType type_index(AbstractType _) = type_index <> cPredefinedModuleIndex +checkAbstractType type_index (AbstractSynType _ _) = type_index <> cPredefinedModuleIndex +checkAbstractType _ _ = False getClassDef :: !Index !Index !Index !u:{# ClassDef} !v:{# DclModule} -> (!ClassDef, !Index , !u:{# ClassDef}, !v:{# DclModule}) getClassDef class_index type_module module_index class_defs modules @@ -584,7 +584,7 @@ checkOpenAType mod_index scope dem_attr_kind type=:{ at_type=TA type_cons=:{type | type_index <> NotFound # ({td_arity,td_args,td_attribute,td_rhs},type_index,ots_type_defs,ots_modules) = getTypeDef type_index type_module mod_index ots_type_defs ots_modules ots = { ots & ots_type_defs = ots_type_defs, ots_modules = ots_modules } - | x_check_dynamic_types && checkAbstractType td_rhs + | x_check_dynamic_types && checkAbstractType type_module td_rhs = (type, (ots, oti, {cs & cs_error = checkError type_name "(abstract type) not permitted in a dynamic type" cs.cs_error})) | checkArityOfType type_cons.type_arity td_arity td_rhs |