add whole_var to tag union/record

the existing var is for the extension (ext_var). during mono we need the whole type to look up the layout, so store that as well
This commit is contained in:
Folkert 2020-03-13 23:28:36 +01:00
parent 129be86233
commit 2e697ee8f9
2 changed files with 47 additions and 19 deletions

View file

@ -662,13 +662,13 @@ fn pattern_to_vars_by_symbol(
vars_by_symbol.insert(symbol.clone(), expr_var);
}
AppliedTag(_, _, arguments) => {
AppliedTag { arguments, .. } => {
for (var, nested) in arguments {
pattern_to_vars_by_symbol(vars_by_symbol, &nested.value, *var);
}
}
RecordDestructure(_, destructs) => {
RecordDestructure { destructs, .. } => {
for destruct in destructs {
vars_by_symbol.insert(destruct.value.symbol.clone(), destruct.value.var);
}