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

```
Module(
    ModModule {
        range: 0..150,
        body: [
            FunctionDef(
                StmtFunctionDef {
                    range: 0..22,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: "foo",
                        range: 4..7,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 7..17,
                        posonlyargs: [],
                        args: [],
                        vararg: Some(
                            Parameter {
                                range: 8..16,
                                name: Identifier {
                                    id: "args",
                                    range: 9..13,
                                },
                                annotation: Some(
                                    Starred(
                                        ExprStarred {
                                            range: 15..16,
                                            value: Name(
                                                ExprName {
                                                    range: 16..16,
                                                    id: "",
                                                    ctx: Invalid,
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                ),
                            },
                        ),
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 19..22,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 19..22,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    range: 23..57,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: "foo",
                        range: 27..30,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 30..52,
                        posonlyargs: [],
                        args: [],
                        vararg: Some(
                            Parameter {
                                range: 31..51,
                                name: Identifier {
                                    id: "args",
                                    range: 32..36,
                                },
                                annotation: Some(
                                    Starred(
                                        ExprStarred {
                                            range: 39..50,
                                            value: Subscript(
                                                ExprSubscript {
                                                    range: 40..50,
                                                    value: Name(
                                                        ExprName {
                                                            range: 40..45,
                                                            id: "tuple",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                    slice: Name(
                                                        ExprName {
                                                            range: 46..49,
                                                            id: "int",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                    ctx: Load,
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                ),
                            },
                        ),
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 54..57,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 54..57,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    range: 58..90,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: "foo",
                        range: 62..65,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 65..85,
                        posonlyargs: [],
                        args: [],
                        vararg: Some(
                            Parameter {
                                range: 66..84,
                                name: Identifier {
                                    id: "args",
                                    range: 67..71,
                                },
                                annotation: Some(
                                    Starred(
                                        ExprStarred {
                                            range: 73..84,
                                            value: BoolOp(
                                                ExprBoolOp {
                                                    range: 74..84,
                                                    op: Or,
                                                    values: [
                                                        Name(
                                                            ExprName {
                                                                range: 74..77,
                                                                id: "int",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                        Name(
                                                            ExprName {
                                                                range: 81..84,
                                                                id: "str",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    ],
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                ),
                            },
                        ),
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 87..90,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 87..90,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    range: 91..120,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: "foo",
                        range: 95..98,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 98..115,
                        posonlyargs: [],
                        args: [],
                        vararg: Some(
                            Parameter {
                                range: 99..114,
                                name: Identifier {
                                    id: "args",
                                    range: 100..104,
                                },
                                annotation: Some(
                                    Starred(
                                        ExprStarred {
                                            range: 106..114,
                                            value: Yield(
                                                ExprYield {
                                                    range: 107..114,
                                                    value: Some(
                                                        Name(
                                                            ExprName {
                                                                range: 113..114,
                                                                id: "x",
                                                                ctx: Load,
                                                            },
                                                        ),
                                                    ),
                                                },
                                            ),
                                            ctx: Load,
                                        },
                                    ),
                                ),
                            },
                        ),
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 117..120,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 117..120,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | def foo(*args: *): ...
  |                 ^ Syntax Error: Expected an expression
2 | def foo(*args: (*tuple[int])): ...
3 | def foo(*args: *int or str): ...
  |


  |
1 | def foo(*args: *): ...
2 | def foo(*args: (*tuple[int])): ...
  |                 ^^^^^^^^^^^ Syntax Error: Starred expression cannot be used here
3 | def foo(*args: *int or str): ...
4 | def foo(*args: *yield x): ...
  |


  |
1 | def foo(*args: *): ...
2 | def foo(*args: (*tuple[int])): ...
3 | def foo(*args: *int or str): ...
  |                 ^^^^^^^^^^ Syntax Error: Boolean expression cannot be used here
4 | def foo(*args: *yield x): ...
5 | # def foo(*args: **int): ...
  |


  |
2 | def foo(*args: (*tuple[int])): ...
3 | def foo(*args: *int or str): ...
4 | def foo(*args: *yield x): ...
  |                 ^^^^^^^ Syntax Error: Yield expression cannot be used here
5 | # def foo(*args: **int): ...
  |
