diff --git a/nac3type/src/inference.rs b/nac3type/src/inference.rs index 28ef48b518..7eb63a2325 100644 --- a/nac3type/src/inference.rs +++ b/nac3type/src/inference.rs @@ -141,6 +141,11 @@ pub fn resolve_call( resolve_call(ctx, Some(obj.clone()), func, args.clone(), assumptions) }) .collect(); + // `assumption` cannot substitute variable for variable, if assumption contains + // this id before running this function, `obj` would not be a variable, so this + // would not be executed. + // Hence, we lose no information doing this. + assumptions.remove(id); let results = results?; if results.iter().all(|v| v == &results[0]) { return Ok(results[0].clone());