fix problem with empty closures still considered closures

This commit is contained in:
Folkert 2020-12-10 23:33:53 +01:00
parent 84421ad06d
commit f5c267acf4
7 changed files with 71 additions and 15 deletions

View file

@ -1636,8 +1636,11 @@ fn specialize_external<'a>(
Layout::Struct(field_layouts) => {
// NOTE closure unions do not store the tag!
let field_layouts = &field_layouts[1..];
// TODO check for field_layouts.len() == 1 and do a rename in that case?
for (index, (symbol, _variable)) in captured.iter().enumerate()
{
// TODO therefore should the wrapped here not be RecordOrSingleTagUnion?
let expr = Expr::AccessAtIndex {
index: index as _,
field_layouts,