This commit is contained in:
Folkert 2020-10-16 00:18:40 +02:00
parent d0f031fe6c
commit 40ffca2b7b
16 changed files with 511 additions and 200 deletions

View file

@ -117,7 +117,11 @@ pub fn canonicalize_pattern<'a>(
&mut env.ident_ids,
region,
) {
Ok(symbol) => Pattern::Identifier(symbol),
Ok(symbol) => {
output.references.bound_symbols.insert(symbol);
Pattern::Identifier(symbol)
}
Err((original_region, shadow)) => {
env.problem(Problem::RuntimeError(RuntimeError::Shadowing {
original_region,
@ -254,6 +258,8 @@ pub fn canonicalize_pattern<'a>(
region,
) {
Ok(symbol) => {
output.references.bound_symbols.insert(symbol);
destructs.push(Located {
region: loc_pattern.region,
value: RecordDestruct {