Revert "[red-knot] Type narrowing for assertions (#17149)" (#17335)

I merged #17149 without checking the ecosystem results, and it still
caused a cycle panic in pybind11. Reverting for now until I fix that, so
we don't lose the ecosystem signal on other PRs.
This commit is contained in:
Carl Meyer 2025-04-10 11:06:25 -04:00 committed by GitHub
parent 907b6ed7b5
commit ec74f2d522
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 65 deletions

View file

@ -534,6 +534,7 @@ impl<'db> SemanticIndexBuilder<'db> {
}
/// Records a visibility constraint by applying it to all live bindings and declarations.
#[must_use = "A visibility constraint must always be negated after it is added"]
fn record_visibility_constraint(
&mut self,
predicate: Predicate<'db>,
@ -1291,17 +1292,6 @@ where
);
}
}
ast::Stmt::Assert(node) => {
self.visit_expr(&node.test);
let predicate = self.record_expression_narrowing_constraint(&node.test);
self.record_visibility_constraint(predicate);
if let Some(msg) = &node.msg {
self.visit_expr(msg);
}
}
ast::Stmt::Assign(node) => {
debug_assert_eq!(&self.current_assignments, &[]);