Skip to content

Commit

Permalink
Fixed edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
bvssvni committed May 29, 2020
1 parent d2866e8 commit 34adea3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -816,6 +816,7 @@ impl Context {
/// This is used on the right side in a reduction rule.
pub fn substitute(&self, x: &Expr) -> Result<Expr, Error> {
match x {
Sym(RetNegVar(_)) => Err(Error::InvalidComputation),
Sym(Var(name)) | Sym(ArityVar(name, _)) => {
for i in (0..self.vars.len()).rev() {
if &self.vars[i].0 == name {
Expand Down

0 comments on commit 34adea3

Please sign in to comment.