ruff/crates/ty_python_semantic/resources/mdtest/diagnostics
Brent Westbrook 2250fa6f98
Fix syntax error false positives for `await` outside functions (#21763)
## Summary

Fixes #21750 and a related bug in `PLE1142`. We were not properly
considering generators to be valid `await` contexts, which caused the
`F704` issue. One of the tests I added for this also uncovered an issue
in `PLE1142` for comprehensions nested within async generators because
we were only checking the current scope rather than traversing the
nested context.

## Test Plan

Both of these rules are implemented as semantic syntax errors, so I
added tests (and fixes) in both Ruff and ty.
2025-12-02 21:02:02 +00:00
..
attribute_assignment.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
invalid_argument_type.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
invalid_assignment.md [ty] Better invalid-assignment diagnostics (#21476) 2025-11-18 14:31:04 +01:00
invalid_await.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
legacy_typevars.md [ty] defer inference of legacy TypeVar bound/constraints/defaults (#20598) 2025-10-09 21:08:37 +00:00
missing_argument.md [ty] Improve diagnostics for bad calls to functions (#20022) 2025-08-21 22:00:44 +01:00
no_matching_overload.md [ty] Improve invalid method calls for unmatched overloads (#18122) 2025-05-15 11:39:14 -04:00
same_names.md [ty] support generic aliases in `type[...]`, like `type[C[int]]` (#21552) 2025-11-24 13:56:42 -08:00
semantic_syntax_errors.md Fix syntax error false positives for `await` outside functions (#21763) 2025-12-02 21:02:02 +00:00
shadowing.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
single_matching_overload.md [ty] Surface matched overload diagnostic directly (#18452) 2025-06-20 08:36:49 +05:30
too_many_positionals.md [ty] Improve diagnostics for bad calls to functions (#20022) 2025-08-21 22:00:44 +01:00
union_call.md [ty] Truncate Literal type display in some situations (#20928) 2025-10-17 11:50:58 +00:00
unknown_argument.md [ty] Improve diagnostics for bad calls to functions (#20022) 2025-08-21 22:00:44 +01:00
unpacking.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unresolved_import.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
unresolved_reference.md [ty] Add a note to the diagnostic if a new builtin is used on an old Python version (#18068) 2025-05-13 10:08:04 -04:00
unsupported_bool_conversion.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
version_related_syntax_errors.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00