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