`AsName.name` has incorrect type annotations
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 229
- PR merge metrics
- No merged PRs in 30d
Description
For example it can be a `Subscript`, not just `Name | List | Tuple`.
In fact I think there are two kinds of `AsName`s - the ones in imports and except handlers can only take a `Name`, while the ones in with statements can accept any target expression (`BaseAssignTargetExpression`).
```
echo 'with x as a[1]: ...' | python -m libcst.tool print -
Module(
body=[
With(
items=[
WithItem(
item=Name(
value='x',
),
asname=AsName(
name=Subscript(
value=Name(
value='a',
),
slice=[
SubscriptElement(
slice=Index(
value=Integer(
value='1',
),
),
),
],
),
),
),
],
body=SimpleStatementSuite(
body=[
Expr(
value=Ellipsis(),
),
],
),
),
],
)
```
Contributor guide
Assessment
This issue has not been assessed yet.