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

```
Module(
    ModModule {
        range: 0..81,
        body: [
            FunctionDef(
                StmtFunctionDef {
                    range: 0..23,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 4..7,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 7..18,
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 8..17,
                                parameter: Parameter {
                                    range: 8..17,
                                    name: Identifier {
                                        id: Name("arg"),
                                        range: 8..11,
                                    },
                                    annotation: Some(
                                        Starred(
                                            ExprStarred {
                                                range: 13..17,
                                                value: Name(
                                                    ExprName {
                                                        range: 14..17,
                                                        id: Name("int"),
                                                        ctx: Load,
                                                    },
                                                ),
                                                ctx: Load,
                                            },
                                        ),
                                    ),
                                },
                                default: None,
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 20..23,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 20..23,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    range: 24..52,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 28..31,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 31..47,
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 32..46,
                                parameter: Parameter {
                                    range: 32..46,
                                    name: Identifier {
                                        id: Name("arg"),
                                        range: 32..35,
                                    },
                                    annotation: Some(
                                        Yield(
                                            ExprYield {
                                                range: 37..46,
                                                value: Some(
                                                    Name(
                                                        ExprName {
                                                            range: 43..46,
                                                            id: Name("int"),
                                                            ctx: Load,
                                                        },
                                                    ),
                                                ),
                                            },
                                        ),
                                    ),
                                },
                                default: None,
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 49..52,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 49..52,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    range: 53..80,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 57..60,
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 60..75,
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 61..67,
                                parameter: Parameter {
                                    range: 61..67,
                                    name: Identifier {
                                        id: Name("arg"),
                                        range: 61..64,
                                    },
                                    annotation: Some(
                                        Name(
                                            ExprName {
                                                range: 66..67,
                                                id: Name("x"),
                                                ctx: Load,
                                            },
                                        ),
                                    ),
                                },
                                default: None,
                            },
                            ParameterWithDefault {
                                range: 71..74,
                                parameter: Parameter {
                                    range: 71..74,
                                    name: Identifier {
                                        id: Name("int"),
                                        range: 71..74,
                                    },
                                    annotation: None,
                                },
                                default: None,
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                range: 77..80,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        range: 77..80,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | def foo(arg: *int): ...
  |              ^^^^ Syntax Error: Starred expression cannot be used here
2 | def foo(arg: yield int): ...
3 | def foo(arg: x := int): ...
  |


  |
1 | def foo(arg: *int): ...
2 | def foo(arg: yield int): ...
  |              ^^^^^^^^^ Syntax Error: Yield expression cannot be used here
3 | def foo(arg: x := int): ...
  |


  |
1 | def foo(arg: *int): ...
2 | def foo(arg: yield int): ...
3 | def foo(arg: x := int): ...
  |                ^^ Syntax Error: Expected ',', found ':='
  |
