Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
ed6f8179
Commit
ed6f8179
authored
Mar 19, 2004
by
Ronny Wichers Schreur
🏘
Browse files
bug fix: use correct index for constructor in constructor definition
parent
27c6f4a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/typereify.icl
View file @
ed6f8179
...
...
@@ -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
{
con
s_ide
nt
,
cons_i
n
de
x
,
cons_type
,
cons_exi_vars
}
instance
reify
(
Int
,
ConsDef
)
where
reify
(
d
s_i
n
de
x
,
{
cons_ide
nt
,
cons_type
,
cons_exi_vars
}
)
=
(
record
PD_CTConsDef
`
(
function
PD__CTToCons
`
consSymbol
cons_ident
con
s_index
)
`
(
function
PD__CTToCons
`
consSymbol
cons_ident
d
s_index
)
`
cons_type
.
st_args
`
length
cons_exi_vars
)
o
numberTypeVariables
cons_exi_vars
where
consSymbol
cons_ident
con
s_index
state
=:{
bs_main
}
consSymbol
cons_ident
d
s_index
state
=:{
bs_main
}
#
cons_symb
=
{
symb_ident
=
cons_ident
,
symb_kind
=
SK_Constructor
{
glob_module
=
bs_main
,
glob_object
=
con
s_index
}
,
symb_kind
=
SK_Constructor
{
glob_module
=
bs_main
,
glob_object
=
d
s_index
}
}
=
reify
cons_symb
state
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment