Emit a [`SemanticSyntaxErrorKind::InvalidStarExpression`] if `expr` is starred.
(expr: &Expr, ctx: &Ctx)
| 553 | |
| 554 | /// Emit a [`SemanticSyntaxErrorKind::InvalidStarExpression`] if `expr` is starred. |
| 555 | fn invalid_star_expression<Ctx: SemanticSyntaxContext>(expr: &Expr, ctx: &Ctx) { |
| 556 | // test_ok single_star_in_tuple |
| 557 | // def f(): yield (*x,) |
| 558 | // def f(): return (*x,) |
| 559 | // for _ in (*x,): ... |
| 560 | // for (*x,) in xs: ... |
| 561 | if expr.is_starred_expr() { |
| 562 | Self::add_error( |
| 563 | ctx, |
| 564 | SemanticSyntaxErrorKind::InvalidStarExpression, |
| 565 | expr.range(), |
| 566 | ); |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | fn multiple_star_expression<Ctx: SemanticSyntaxContext>( |
| 571 | ctx: &Ctx, |
nothing calls this directly
no test coverage detected