Formatting

This commit is contained in:
Michael Schimmel
2026-02-24 08:51:51 +01:00
parent 51d83562de
commit 6810d5fa9f
3 changed files with 16 additions and 12 deletions
+4 -1
View File
@@ -487,7 +487,10 @@ impl Binder {
}, },
)) ))
} }
_ => Err(format!("Invalid node in assignment pattern: {:?}", node.kind)), _ => Err(format!(
"Invalid node in assignment pattern: {:?}",
node.kind
)),
} }
} }
+2 -4
View File
@@ -103,8 +103,7 @@ impl Optimizer {
BoundKind::DefGlobal { global_index, .. } => { BoundKind::DefGlobal { global_index, .. } => {
info.assigned_globals.insert(*global_index); info.assigned_globals.insert(*global_index);
} }
BoundKind::Set { addr, .. } => { BoundKind::Set { addr, .. } => match addr {
match addr {
Address::Local(slot) => { Address::Local(slot) => {
info.assigned_locals.insert(*slot); info.assigned_locals.insert(*slot);
} }
@@ -112,8 +111,7 @@ impl Optimizer {
info.assigned_globals.insert(*idx); info.assigned_globals.insert(*idx);
} }
_ => {} _ => {}
} },
}
BoundKind::Tuple { elements } => { BoundKind::Tuple { elements } => {
for el in elements { for el in elements {
self.collect_pattern_usage(el, info); self.collect_pattern_usage(el, info);
+4 -1
View File
@@ -163,7 +163,10 @@ impl TypeChecker {
specialized_ty.clone(), 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. // 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. // 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, // Note: For now, we assume assignments are compatible if types were already inferred,