Merge pull request #2050 from rtfeldman/empty-tags-and-unions

Canonicalize to empty tags and unions
This commit is contained in:
hafiz 2021-11-22 08:00:07 -06:00 committed by GitHub
commit b3ecc16b16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 27 deletions

View file

@ -1578,9 +1578,7 @@ fn layout_from_flat_type<'a>(
Ok(Layout::Union(union_layout))
}
EmptyTagUnion => {
panic!("TODO make Layout for empty Tag Union");
}
EmptyTagUnion => Ok(Layout::Union(UnionLayout::NonRecursive(&[]))),
Erroneous(_) => Err(LayoutProblem::Erroneous),
EmptyRecord => Ok(Layout::Struct(&[])),
}