From 530ef2684cd176f2f23b734de0394f08dc931ce8 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Wed, 28 Aug 2024 07:20:49 -0600 Subject: [PATCH] [red-knot] use debug_assert for name ctx in `infer_type_expression` Co-authored-by: Alex Waygood --- crates/red_knot_python_semantic/src/types/infer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/red_knot_python_semantic/src/types/infer.rs b/crates/red_knot_python_semantic/src/types/infer.rs index 8197174690df73..aa781c571a5c0b 100644 --- a/crates/red_knot_python_semantic/src/types/infer.rs +++ b/crates/red_knot_python_semantic/src/types/infer.rs @@ -1279,7 +1279,7 @@ impl<'db> TypeInferenceBuilder<'db> { // stub of the forms other than a standalone name in scope. match expression { ast::Expr::Name(name) => { - assert!( + debug_assert!( name.ctx.is_load(), "name in a type expression is always 'load' but got: '{:?}'", name.ctx