Commit ee7ef8c2 authored by johnvg@science.ru.nl's avatar johnvg@science.ru.nl
Browse files

prevent compiler crash if a generic function has a type context with an undefined type variable

parent eced19e1
......@@ -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}
# 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 & 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, 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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment