diff --git a/src/ast/compiler/binder.rs b/src/ast/compiler/binder.rs index 76e43d8..36c8466 100644 --- a/src/ast/compiler/binder.rs +++ b/src/ast/compiler/binder.rs @@ -487,7 +487,10 @@ impl Binder { }, )) } - _ => Err(format!("Invalid node in assignment pattern: {:?}", node.kind)), + _ => Err(format!( + "Invalid node in assignment pattern: {:?}", + node.kind + )), } } diff --git a/src/ast/compiler/optimizer.rs b/src/ast/compiler/optimizer.rs index 6ac3822..b070ef7 100644 --- a/src/ast/compiler/optimizer.rs +++ b/src/ast/compiler/optimizer.rs @@ -103,17 +103,15 @@ impl Optimizer { BoundKind::DefGlobal { global_index, .. } => { info.assigned_globals.insert(*global_index); } - BoundKind::Set { addr, .. } => { - match addr { - Address::Local(slot) => { - info.assigned_locals.insert(*slot); - } - Address::Global(idx) => { - info.assigned_globals.insert(*idx); - } - _ => {} + BoundKind::Set { addr, .. } => match addr { + Address::Local(slot) => { + info.assigned_locals.insert(*slot); } - } + Address::Global(idx) => { + info.assigned_globals.insert(*idx); + } + _ => {} + }, BoundKind::Tuple { elements } => { for el in elements { self.collect_pattern_usage(el, info); diff --git a/src/ast/compiler/type_checker.rs b/src/ast/compiler/type_checker.rs index fcf08b3..fe6a705 100644 --- a/src/ast/compiler/type_checker.rs +++ b/src/ast/compiler/type_checker.rs @@ -163,7 +163,10 @@ impl TypeChecker { specialized_ty.clone(), ) } - BoundKind::Set { addr, value: _value } => { + BoundKind::Set { + addr, + value: _value, + } => { // In an assignment pattern, 'value' is just a Nop placeholder from the Binder. // We update the type of the address (if it's a local or global) to match the specialized type. // Note: For now, we assume assignments are compatible if types were already inferred,