fix(codegen): tuple pattern scopes

Co-authored-by: Kasey White <kwhitemsg@gmail.com>
This commit is contained in:
rvcas 2023-03-09 19:30:52 -05:00
parent f377d60085
commit 6440c4f498
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
1 changed files with 7 additions and 0 deletions

View File

@ -1939,8 +1939,15 @@ impl<'a> CodeGenerator<'a> {
| Pattern::Constructor { .. }
| Pattern::Tuple { .. }) => {
let mut var_vec = vec![];
let item_name = format!("list_item_id_{}", self.id_gen.next());
names.push(item_name.clone());
let mut scope = scope.clone();
scope.push(self.id_gen.next());
var_vec.push(Air::Var {
constructor: ValueConstructor::public(
Type::App {