Emit a [`SemanticSyntaxErrorKind::InvalidStarExpression`] if `expr` is starred.
(expr: &Expr, ctx: &Ctx)
| 543 | |
| 544 | /// Emit a [`SemanticSyntaxErrorKind::InvalidStarExpression`] if `expr` is starred. |
| 545 | fn invalid_star_expression<Ctx: SemanticSyntaxContext>(expr: &Expr, ctx: &Ctx) { |
| 546 | // test_ok single_star_in_tuple |
| 547 | // def f(): yield (*x,) |
| 548 | // def f(): return (*x,) |
| 549 | // for _ in (*x,): ... |
| 550 | // for (*x,) in xs: ... |
| 551 | if expr.is_starred_expr() { |
| 552 | Self::add_error( |
| 553 | ctx, |
| 554 | SemanticSyntaxErrorKind::InvalidStarExpression, |
| 555 | expr.range(), |
| 556 | ); |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | fn multiple_star_expression<Ctx: SemanticSyntaxContext>( |
| 561 | ctx: &Ctx, |
nothing calls this directly
no test coverage detected