special-case the closure tags

This commit is contained in:
Folkert 2021-11-24 21:14:58 +01:00
parent 3e640f78bf
commit cb8e9acb92
4 changed files with 45 additions and 14 deletions

View file

@ -690,6 +690,19 @@ fn type_to_variable<'a>(
EmptyRec => Variable::EMPTY_RECORD,
EmptyTagUnion => Variable::EMPTY_TAG_UNION,
ClosureTag { name, ext } => {
let tag_name = TagName::Closure(*name);
let tag_names = SubsSlice::new(subs.tag_names.len() as u32, 1);
subs.tag_names.push(tag_name);
let union_tags = UnionTags::from_slices(tag_names, SubsSlice::default());
let content = Content::Structure(FlatType::TagUnion(union_tags, *ext));
register(subs, rank, pools, content)
}
// This case is important for the rank of boolean variables
Function(arguments, closure_type, ret_type) => {
let new_arguments = VariableSubsSlice::reserve_into_subs(subs, arguments.len());