Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify quote annotator logic for list expression (#14425)
## Summary Follow-up to #14371, this PR simplifies the visitor logic for list expressions to remove the state management. We just need to make sure that we visit the nested expressions using the `QuoteAnnotator` and not the `Generator`. This is similar to what's being done for binary expressions. As per the [grammar](https://typing.readthedocs.io/en/latest/spec/annotations.html#grammar-token-expression-grammar-annotation_expression), list expressions can be present which can contain other type expressions (`Callable`): ``` | <Callable> '[' <Concatenate> '[' (type_expression ',')+ (name | '...') ']' ',' type_expression ']' (where name must be a valid in-scope ParamSpec) | <Callable> '[' '[' maybe_unpacked (',' maybe_unpacked)* ']' ',' type_expression ']' ``` ## Test Plan `cargo insta test`
- Loading branch information