fix: case where identity function was used as a param.
This was causing a free unique. The fix is after stripping applied usage of identity, we then check if it is passed around and if so we leave in the function declaration.
This commit is contained in:
parent
d6afaa7540
commit
340ed3b6a5
|
@ -235,7 +235,13 @@ fn inline_identity_reduce(term: &mut Term<Name>) {
|
|||
};
|
||||
|
||||
if identity_var.as_ref() == identity_name.as_ref() {
|
||||
*term = replace_identity_usage(body, parameter_name.clone());
|
||||
let temp_term = replace_identity_usage(body, parameter_name.clone());
|
||||
if var_occurrences(body, parameter_name.clone()) > 0 {
|
||||
let body = Rc::make_mut(body);
|
||||
*body = temp_term;
|
||||
} else {
|
||||
*term = temp_term;
|
||||
}
|
||||
}
|
||||
}
|
||||
Term::Force(f) => {
|
||||
|
|
Loading…
Reference in New Issue