[red-knot] Narrowing - Not operator #13942
Merged
carljm merged 2 commits intoastral-sh:mainfrom Oct 28, 2024
Merged
Conversation
Contributor
|
carljm
approved these changes
Oct 28, 2024
Contributor
carljm
left a comment
There was a problem hiding this comment.
This is awesome, thank you!!
crates/red_knot_python_semantic/resources/mdtest/narrow/conditionals_not.md
Outdated
Show resolved
Hide resolved
Contributor
I like what you've done here. I think in general any feature that makes sense to make a PR to add, probably makes sense to have a dedicated file to test as well. Which of course isn't incompatible with perhaps also having it occasionally show up in tests of other features, too, but not in a "must add it everywhere" way. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After #13918 has landed, narrowing constraint negation became easy, so adding support for
notoperator.Test Plan
I added a new mdtest file for
notexpression, but maybe we should spread it over the other test files (by addingnotcases to each one of them)? I'll be happy to hear your preference around that :)