mirror of https://github.com/astral-sh/ruff
## Summary
<!-- What's the purpose of the change? What does it do, and why? -->
This PR implements a new semantic syntax error where annotated name
can't be global
example
```
x: int = 1
def f():
global x
x: str = "foo" # SyntaxError: annotated name 'x' can't be global
```
## Test Plan
<!-- How was it tested? -->
I have written tests as directed in #17412
---------
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <bhuminjaysoni@gmail.com>
Co-authored-by: Brent Westbrook <brentrwestbrook@gmail.com>
|
||
|---|---|---|
| .. | ||
| lexer | ||
| parser | ||
| snapshots | ||
| error.rs | ||
| lexer.rs | ||
| lib.rs | ||
| semantic_errors.rs | ||
| string.rs | ||
| token.rs | ||
| token_set.rs | ||
| token_source.rs | ||
| typing.rs | ||