ruff/crates/ruff_linter/resources/test/fixtures/semantic_errors
Bhuminjay Soni 52849a5e68
[syntax-errors] Annotated name cannot be global (#20868)
## 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>
2025-12-17 08:39:47 -05:00
..
annotated_global.py [syntax-errors] Annotated name cannot be global (#20868) 2025-12-17 08:39:47 -05:00
async_comprehension_outside_async_function.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
duplicate_match_class_attribute.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
duplicate_match_key.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
duplicate_type_parameter.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
global_parameter.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
invalid_expression.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
invalid_star_expression.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
irrefutable_case_pattern.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
multiple_case_assignment.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
rebound_comprehension.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
single_starred_assignment.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00
write_to_debug.py [semantic error tests]: refactor semantic error tests to separate files (#20926) 2025-10-27 21:18:11 +00:00