diff options
author | ronny | 2004-03-19 10:36:53 +0000 |
---|---|---|
committer | ronny | 2004-03-19 10:36:53 +0000 |
commit | 87b29aa508f6bc9b2a4d8033bfe2452475b4513d (patch) | |
tree | 8d4353ee8f386060f08a1522e71e9113191523a6 /frontend/typereify.icl | |
parent | reification of type definitions (diff) |
bug fix: use correct index for constructor in constructor definition
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1468 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/typereify.icl')
-rw-r--r-- | frontend/typereify.icl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/frontend/typereify.icl b/frontend/typereify.icl index dab9fde..4ea219b 100644 --- a/frontend/typereify.icl +++ b/frontend/typereify.icl @@ -211,7 +211,8 @@ buildTypeFunctions main icl_functions common_defs predefs var_heap type_heaps = common_defs.[main].com_type_defs # (type_funs, bs_state) = build 0 (size type_defs) type_defs icl_functions bs_state - = (type_funs, bs_state.bs_predefs, bs_state.bs_var_heap, bs_state.bs_type_heaps) + = (type_funs, bs_state.bs_predefs, bs_state.bs_var_heap, + bs_state.bs_type_heaps) where build i n type_defs functions bs_state | i < n @@ -417,7 +418,7 @@ instance reify TypeRhs where = cons PD_CTAlgType ` get constructors where get constructors state=:{bs_common_defs, bs_main} - = reify [common_defs.[ds_index] \\ {ds_index} <- constructors] state + = reify [(ds_index,common_defs.[ds_index]) \\ {ds_index} <- constructors] state where common_defs = bs_common_defs.[bs_main].com_cons_defs @@ -426,17 +427,17 @@ instance reify TypeRhs where reify (SynType _) = cons PD_CTSynType -instance reify ConsDef where - reify {cons_ident, cons_index, cons_type, cons_exi_vars} +instance reify (Int, ConsDef) where + reify (ds_index, {cons_ident, cons_type, cons_exi_vars}) = (record PD_CTConsDef - ` (function PD__CTToCons ` consSymbol cons_ident cons_index) + ` (function PD__CTToCons ` consSymbol cons_ident ds_index) ` cons_type.st_args ` length cons_exi_vars) o numberTypeVariables cons_exi_vars where - consSymbol cons_ident cons_index state=:{bs_main} + consSymbol cons_ident ds_index state=:{bs_main} # cons_symb = { symb_ident = cons_ident - , symb_kind = SK_Constructor { glob_module = bs_main, glob_object = cons_index} + , symb_kind = SK_Constructor { glob_module = bs_main, glob_object = ds_index} } = reify cons_symb state |