From 94ea2c7a9df19290fd99ba3a56fcec05dee63297 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Tue, 29 Dec 2020 09:43:49 +0800 Subject: [PATCH] fixed assumption bug --- nac3type/src/inference.rs | 5 +++++ 1 file changed, 5 insertions(+) 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());