single record update

This commit is contained in:
Folkert 2021-06-21 22:26:53 +02:00
parent ee941c9f2e
commit a94f597e1e
2 changed files with 68 additions and 54 deletions

View file

@ -1061,15 +1061,13 @@ fn path_to_expr_help<'a>(
(union_layout.layout_at(*tag_id as u8, index as usize), expr)
}
Layout::Struct(field_layouts) => {
let wrapped = Wrapped::opt_from_layout(&layout).unwrap();
debug_assert!(field_layouts.len() > 1);
debug_assert_eq!(wrapped, Wrapped::RecordOrSingleTagUnion);
let expr = Expr::AccessAtIndex {
index,
field_layouts,
structure: symbol,
wrapped,
wrapped: Wrapped::RecordOrSingleTagUnion,
};
let layout = field_layouts[index as usize];