Add object-oriented records example
This commit is contained in:
@@ -472,9 +472,12 @@ impl Optimizer {
|
||||
|
||||
for (old_idx, capture_addr) in original_upvalues.iter().enumerate() {
|
||||
let mut inlined_val = None;
|
||||
if let Some(val) = sub.get_value(capture_addr) {
|
||||
if !sub.assigned.contains(capture_addr)
|
||||
&& let Some(val) = sub.get_value(capture_addr)
|
||||
{
|
||||
inlined_val = Some(val.clone());
|
||||
}
|
||||
|
||||
if let Address::Local(slot) = capture_addr {
|
||||
sub.captured_slots.insert(*slot);
|
||||
}
|
||||
|
||||
@@ -159,9 +159,7 @@ impl UsageInfo {
|
||||
|
||||
pub fn collect_pattern(&mut self, node: &AnalyzedNode) {
|
||||
match &node.kind {
|
||||
BoundKind::Define { addr, .. } => {
|
||||
self.assigned.insert(*addr);
|
||||
}
|
||||
BoundKind::Define { .. } => {}
|
||||
BoundKind::Set { addr, .. } => {
|
||||
self.assigned.insert(*addr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user