use captured_symbols to determine the closure type

This commit is contained in:
Folkert 2020-10-15 16:17:59 +02:00
parent b7e099a6c8
commit d0f031fe6c
4 changed files with 12 additions and 20 deletions

View file

@ -504,6 +504,13 @@ fn layout_from_flat_type<'a>(
arena.alloc([Layout::Builtin(builtin.clone())]),
arena.alloc(ret),
)),
Ok(Layout::Struct(&[])) => {
// TODO check for stack size of 0, rather than empty record specifically
Ok(Layout::FunctionPointer(
fn_args.into_bump_slice(),
arena.alloc(ret),
))
}
Ok(Layout::Struct(closure_layouts)) => Ok(Layout::Closure(
fn_args.into_bump_slice(),
closure_layouts,