ruff/crates/ruff_python_semantic
Charlie Marsh 26098b8d91
Extend nested union detection to handle bitwise or Union expressions (#6399)
## Summary

We have some logic in the expression analyzer method to avoid
re-checking the inner `Union` in `Union[Union[...]]`, since the methods
that analyze `Union` expressions already recurse. Elsewhere, we have
logic to avoid re-checking the inner `|` in `int | (int | str)`, for the
same reason.

This PR unifies that logic into a single method _and_ ensures that, just
as we recurse over both `Union` and `|`, we also detect that we're in
_either_ kind of nested union.

Closes https://github.com/astral-sh/ruff/issues/6285.

## Test Plan

Added some new snapshots.
2023-08-07 15:17:26 -04:00
..
src Extend nested union detection to handle bitwise or Union expressions (#6399) 2023-08-07 15:17:26 -04:00
Cargo.toml Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00