From 89b45ed82a6910be2a5c8c8de303c95d7b385c5d Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Tue, 7 Nov 2023 09:26:51 +0000 Subject: [PATCH] Update comments, remove redundant assert --- src/extension/infer.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/extension/infer.rs b/src/extension/infer.rs index 5ebb0b8b7..47eb88e67 100644 --- a/src/extension/infer.rs +++ b/src/extension/infer.rs @@ -553,17 +553,13 @@ impl UnificationContext { if loc.1 == Direction::Incoming { results.insert(loc.0, rs.clone()); } - } else if !depends_on_var.contains(&self.resolve(*meta)) { - // If it depends on some other live meta, that's bad news. - return Err(InferExtensionError::Unsolved { location: *loc }); + } else { + // Unsolved nodes must be unsolved because they depend on graph variables. + if !depends_on_var.contains(&self.resolve(*meta)) { + return Err(InferExtensionError::Unsolved { location: *loc }); + } } - // If it ("only"??) depends on graph variables, then we don't have - // a *solution*, but it's fine } - debug_assert!(self - .extensions - .values() - .all(|m| self.get_solution(m).is_some() || depends_on_var.contains(&self.resolve(*m)))); Ok(results) }