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
ee7ef8c2
Commit
ee7ef8c2
authored
Jun 25, 2019
by
johnvg@science.ru.nl
Browse files
prevent compiler crash if a generic function has a type context with an undefined type variable
parent
eced19e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/checkgenerics.icl
View file @
ee7ef8c2
...
...
@@ -62,15 +62,12 @@ where
#!
(
checked_gen_vars
,
cs
)
=
check_generic_vars
gen_vars
checked_gen_type
.
st_vars
cs
#!
checked_gen_type
=
{
checked_gen_type
&
st_vars
=
move_gen_vars
checked_gen_vars
checked_gen_type
.
st_vars
}
#!
(
hp_type_heaps
,
cs
)
=
check_no_generic_vars_in_contexts
checked_gen_type
checked_gen_vars
hp_type_heaps
cs
=
(
{
gen_def
&
gen_type
=
checked_gen_type
,
gen_vars
=
checked_gen_vars
}
,
type_defs
,
class_defs
,
modules
,
{
heaps
&
hp_type_heaps
=
hp_type_heaps
}
,
cs
)
#
gen_def
&
gen_type
=
checked_gen_type
,
gen_vars
=
checked_gen_vars
|
not
cs
.
cs_error
.
ea_ok
// do not call check_no_generic_vars_in_contexts if a contraint contains an unused type variable (not added to st_vars)
=
(
gen_def
,
type_defs
,
class_defs
,
modules
,
{
heaps
&
hp_type_heaps
=
hp_type_heaps
},
cs
)
#!
(
hp_type_heaps
,
cs
)
=
check_no_generic_vars_in_contexts
checked_gen_type
checked_gen_vars
hp_type_heaps
cs
=
(
gen_def
,
type_defs
,
class_defs
,
modules
,
{
heaps
&
hp_type_heaps
=
hp_type_heaps
},
cs
)
where
check_generic_vars
gen_vars
st_vars
cs
=:{
cs_error
}
#
(
gen_vars
,
_,
cs_error
)
=
foldSt
check_generic_var
gen_vars
([],
st_vars
,
cs_error
)
...
...
John van Groningen
@johnvg
mentioned in issue
#40 (closed)
·
Jun 25, 2019
mentioned in issue
#40 (closed)
mentioned in issue #40
Toggle commit list
Write
Preview
Supports
Markdown
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