---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_invalid_value.py
---
## AST

```
Module(
    ModModule {
        range: 0..65,
        body: [
            AnnAssign(
                StmtAnnAssign {
                    range: 0..17,
                    target: Name(
                        ExprName {
                            range: 0..1,
                            id: "x",
                            ctx: Store,
                        },
                    ),
                    annotation: Name(
                        ExprName {
                            range: 3..6,
                            id: "Any",
                            ctx: Load,
                        },
                    ),
                    value: Some(
                        Starred(
                            ExprStarred {
                                range: 9..17,
                                value: BoolOp(
                                    ExprBoolOp {
                                        range: 10..17,
                                        op: And,
                                        values: [
                                            Name(
                                                ExprName {
                                                    range: 10..11,
                                                    id: "a",
                                                    ctx: Load,
                                                },
                                            ),
                                            Name(
                                                ExprName {
                                                    range: 16..17,
                                                    id: "b",
                                                    ctx: Load,
                                                },
                                            ),
                                        ],
                                    },
                                ),
                                ctx: Load,
                            },
                        ),
                    ),
                    simple: true,
                },
            ),
            AnnAssign(
                StmtAnnAssign {
                    range: 18..28,
                    target: Name(
                        ExprName {
                            range: 18..19,
                            id: "x",
                            ctx: Store,
                        },
                    ),
                    annotation: Name(
                        ExprName {
                            range: 21..24,
                            id: "Any",
                            ctx: Load,
                        },
                    ),
                    value: Some(
                        Name(
                            ExprName {
                                range: 27..28,
                                id: "x",
                                ctx: Load,
                            },
                        ),
                    ),
                    simple: true,
                },
            ),
            Expr(
                StmtExpr {
                    range: 32..33,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            range: 32..33,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            AnnAssign(
                StmtAnnAssign {
                    range: 34..64,
                    target: Name(
                        ExprName {
                            range: 34..35,
                            id: "x",
                            ctx: Store,
                        },
                    ),
                    annotation: Name(
                        ExprName {
                            range: 37..41,
                            id: "list",
                            ctx: Load,
                        },
                    ),
                    value: Some(
                        List(
                            ExprList {
                                range: 44..64,
                                elts: [
                                    Name(
                                        ExprName {
                                            range: 45..46,
                                            id: "x",
                                            ctx: Load,
                                        },
                                    ),
                                    Starred(
                                        ExprStarred {
                                            range: 48..54,
                                            value: BinOp(
                                                ExprBinOp {
                                                    range: 49..54,
                                                    left: Name(
                                                        ExprName {
                                                            range: 49..50,
                                                            id: "a",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                    op: BitOr,
                                                    right: Name(
                                                        ExprName {
                                                            range: 53..54,
                                                            id: "b",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                    Starred(
                                        ExprStarred {
                                            range: 56..63,
                                            value: BoolOp(
                                                ExprBoolOp {
                                                    range: 57..63,
                                                    op: Or,
                                                    values: [
                                                        Name(
                                                            ExprName {
                                                                range: 57..58,
                                                                id: "a",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                        Name(
                                                            ExprName {
                                                                range: 62..63,
                                                                id: "b",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    ],
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                ],
                                ctx: Load,
                            },
                        ),
                    ),
                    simple: true,
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | x: Any = *a and b
  |           ^^^^^^^ Syntax Error: Boolean expression cannot be used here
2 | x: Any = x := 1
3 | x: list = [x, *a | b, *a or b]
  |


  |
1 | x: Any = *a and b
2 | x: Any = x := 1
  |            ^^ Syntax Error: Expected a statement
3 | x: list = [x, *a | b, *a or b]
  |


  |
1 | x: Any = *a and b
2 | x: Any = x := 1
3 | x: list = [x, *a | b, *a or b]
  |                        ^^^^^^ Syntax Error: Boolean expression cannot be used here
  |
