aboutsummaryrefslogtreecommitdiff
path: root/frontend/typereify.icl
diff options
context:
space:
mode:
authorronny2004-04-19 14:19:38 +0000
committerronny2004-04-19 14:19:38 +0000
commit46d10df341f0c1bbc5452dabea0210b2599039bb (patch)
tree260fde8c24e404fb771bc86df45dd91d6db8ebd4 /frontend/typereify.icl
parentmark lazy and/or curried entries of cons for list of unboxed records (diff)
remove TC; types
type constructors in dynamic types are now uniquely represented by the descriptor of their TD_ (type definition) function git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1486 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/typereify.icl')
-rw-r--r--frontend/typereify.icl35
1 files changed, 9 insertions, 26 deletions
diff --git a/frontend/typereify.icl b/frontend/typereify.icl
index 3f4c1cf..8085c9a 100644
--- a/frontend/typereify.icl
+++ b/frontend/typereify.icl
@@ -598,8 +598,8 @@ instance reify GlobalTCType where
# predef_type_index
= type_index + FirstTypePredefinedSymbolIndex
= function (predefinedTypeConstructor predef_type_index)
- reify (GTT_Constructor type_cons type_fun)
- = function PD_Dyn__to_TypeCodeConstructor ` type_cons ` type_fun
+ reify (GTT_Constructor type_fun)
+ = function PD_Dyn__to_TypeCodeConstructor ` type_fun
predefinedTypeConstructor predef_type_index
| predef_type_index == PD_ListType
@@ -638,38 +638,21 @@ basic value
// copied and adopted from overloading
toTypeCodeConstructor type=:{glob_object=type_index, glob_module=module_index} common_defs
| module_index == cPredefinedModuleIndex
- = GTT_PredefTypeConstructor type
+ = GTT_PredefTypeConstructor type
// otherwise
- # tc_type_index
- = type_index + 1
- # types
- = common_defs.[module_index].com_type_defs
- // sanity check ...
- # type_ident
- = types.[type_index].td_ident.id_name
- # tc_type_name
- = types.[tc_type_index].td_ident.id_name
- | "TC;" +++ type_ident <> tc_type_name
- = fatal "toTypeCodeConstructor" ("name mismatch (" +++ type_ident +++ ", " +++ tc_type_name +++ ")")
- // ... sanity check
- # ({td_rhs=AlgType [{ds_ident, ds_index}:_]})
- = types.[tc_type_index]
- # type_constructor
- = { symb_ident = ds_ident
- , symb_kind = SK_Constructor {glob_module = module_index, glob_object = ds_index}
- }
+ # type
+ = common_defs.[module_index].com_type_defs.[type_index]
# td_fun_index
- = types.[type_index].td_fun_index
+ = type.td_fun_index
// sanity check ...
| td_fun_index == NoIndex
- = fatal "toTypeCodeConstructor" ("no function (" +++ type_ident
- +++ " type " +++ toString type_index +++ " module " +++ toString module_index +++ ")")
+ = fatal "toTypeCodeConstructor" ("no function (" +++ type.td_ident.id_name +++ ")")
// ... sanity check
# type_fun
- = { symb_ident = {ds_ident & id_info = nilPtr} // this is wrong but let's give it a try
+ = { symb_ident = {type.td_ident & id_info = nilPtr} // this is wrong but let's give it a try
, symb_kind = SK_Function {glob_module = module_index, glob_object = td_fun_index}
}
- = GTT_Constructor type_constructor type_fun
+ = GTT_Constructor type_fun
fatal :: {#Char} {#Char} -> .a
fatal function_name message