Formatting
This commit is contained in:
@@ -487,7 +487,10 @@ impl Binder {
|
||||
},
|
||||
))
|
||||
}
|
||||
_ => Err(format!("Invalid node in assignment pattern: {:?}", node.kind)),
|
||||
_ => Err(format!(
|
||||
"Invalid node in assignment pattern: {:?}",
|
||||
node.kind
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user