Emit a [`SemanticSyntaxErrorKind::InvalidStarExpression`] if `expr` is starred.
(expr: &Expr, ctx: &Ctx)
| 525 | |
| 526 | /// Emit a [`SemanticSyntaxErrorKind::InvalidStarExpression`] if `expr` is starred. |
| 527 | fn invalid_star_expression<Ctx: SemanticSyntaxContext>(expr: &Expr, ctx: &Ctx) { |
| 528 | // test_ok single_star_in_tuple |
| 529 | // def f(): yield (*x,) |
| 530 | // def f(): return (*x,) |
| 531 | // for _ in (*x,): ... |
| 532 | // for (*x,) in xs: ... |
| 533 | if expr.is_starred_expr() { |
| 534 | Self::add_error( |
| 535 | ctx, |
| 536 | SemanticSyntaxErrorKind::InvalidStarExpression, |
| 537 | expr.range(), |
| 538 | ); |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | fn multiple_star_expression<Ctx: SemanticSyntaxContext>( |
| 543 | ctx: &Ctx, |
nothing calls this directly
no test coverage detected