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

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 {