Skip to content

Commit

Permalink
Merge up
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Sep 19, 2023
2 parents 8cb08be + 7a8eec8 commit cf197c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/compiler/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,18 @@ fn rename_in_bodyform(
},

BodyForm::Call(l, vs, tail) => {
let new_vs = map_m(
let mut new_vs = map_m(
&|x: &Rc<BodyForm>| -> Result<Rc<BodyForm>, CompileErr> {
Ok(Rc::new(rename_in_bodyform(namemap, x.clone())?))
},
vs,
)?;
// Ensure that we haven't renamed the 0th element of a call
// They exist in a separate (global) namespace of callables
// and aren't in the variable scope stack.
if !vs.is_empty() {
new_vs[0] = vs[0].clone();
}
let new_tail = if let Some(t) = tail.as_ref() {
Some(Rc::new(rename_in_bodyform(namemap, t.clone())?))
} else {
Expand Down

0 comments on commit cf197c9

Please sign in to comment.