code gen for variably-sized closures

This commit is contained in:
Folkert 2020-10-21 13:01:27 +02:00
parent 1953f563f7
commit c8c1a0678a
6 changed files with 322 additions and 311 deletions

View file

@ -717,6 +717,7 @@ pub fn constrain_expr(
arguments,
loc_body: boxed,
captured_symbols,
name,
..
} => {
use roc_can::expr::Recursive;
@ -799,8 +800,7 @@ pub fn constrain_expr(
));
}
let tag_name_string = format!("Closure_{}", closure_var.index());
let tag_name = roc_module::ident::TagName::Global(tag_name_string.into());
let tag_name = roc_module::ident::TagName::Closure(*name);
let closure_type = Type::TagUnion(
vec![(tag_name, tag_arguments)],
Box::new(Type::Variable(closure_ext_var)),