-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[red-knot] Ensure differently ordered unions and intersections are un…
…derstood as equivalent even inside arbitrarily nested tuples (#15740) ## Summary On `main`, red-knot: - Considers `P | Q` equivalent to `Q | P` - Considered `tuple[P | Q]` equivalent to `tuple[Q | P]` - Considers `tuple[P | tuple[P | Q]]` equivalent to `tuple[tuple[Q | P] | P]` -‼️ Does _not_ consider `tuple[tuple[P | Q]]` equivalent to `tuple[tuple[Q | P]]` The key difference for the last one of these is that the union appears inside a tuple that is directly nested inside another tuple. This PR fixes this so that differently ordered unions are considered equivalent even when they appear inside arbitrarily nested tuple types. ## Test Plan - Added mdtests that fails on `main` - Checked that all property tests continue to pass with this PR
- Loading branch information
1 parent
a77a32b
commit f85ea1b
Showing
2 changed files
with
85 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters