fixing tests

This commit is contained in:
Folkert 2020-07-31 00:49:16 +02:00
parent 01f9539d8e
commit f48a661b3d
3 changed files with 9 additions and 7 deletions

View file

@ -77,7 +77,12 @@ pub fn symbols_from_pattern_help(pattern: &Pattern, symbols: &mut Vec<Symbol>) {
}
RecordDestructure { destructs, .. } => {
for destruct in destructs {
symbols.push(destruct.value.symbol);
// when a record field has a pattern guard, only symbols in the guard are introduced
if let DestructType::Guard(_, subpattern) = &destruct.value.typ {
symbols_from_pattern_help(&subpattern.value, symbols);
} else {
symbols.push(destruct.value.symbol);
}
}
}