Add a [`SemanticSyntaxErrorKind::ReboundComprehensionVariable`] if `expr` rebinds an iteration variable in `generators`.
(
expr: &Expr,
comprehensions: &[ast::Comprehension],
ctx: &Ctx,
)
| 1201 | /// Add a [`SemanticSyntaxErrorKind::ReboundComprehensionVariable`] if `expr` rebinds an |
| 1202 | /// iteration variable in `generators`. |
| 1203 | fn check_generator_expr<Ctx: SemanticSyntaxContext>( |
| 1204 | expr: &Expr, |
| 1205 | comprehensions: &[ast::Comprehension], |
| 1206 | ctx: &Ctx, |
| 1207 | ) { |
| 1208 | Self::check_rebound_variables( |
| 1209 | expr, |
| 1210 | comprehension_target_names(comprehensions), |
| 1211 | FxHashSet::default(), |
| 1212 | ctx, |
| 1213 | ); |
| 1214 | Self::check_class_body_expr(expr, ctx); |
| 1215 | } |
| 1216 | |
| 1217 | fn check_generator_clauses<Ctx: SemanticSyntaxContext>( |
| 1218 | generators: &[ast::Comprehension], |
nothing calls this directly
no test coverage detected